<html>
<head><meta charset="utf-8"><title>Assoc items on `Self` cycle errors #74130 · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html">Assoc items on `Self` cycle errors #74130</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="215018538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215018538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215018538">(Oct 29 2020 at 19:48)</a>:</h4>
<p>I'm going to try <span class="user-mention" data-user-id="116009">@nikomatsakis</span>'s <a href="https://github.com/rust-lang/rust/pull/74130#issuecomment-712462155">approach</a> for this issue</p>



<a name="215018610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215018610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215018610">(Oct 29 2020 at 19:48)</a>:</h4>
<p>we were talking and come with the idea of passing <code>assoc_name</code> down to <a href="https://github.com/rust-lang/rust/blob/2a71e45411881dda12a704d7491428d8a23347c0/compiler/rustc_typeck/src/astconv/mod.rs#L63">https://github.com/rust-lang/rust/blob/2a71e45411881dda12a704d7491428d8a23347c0/compiler/rustc_typeck/src/astconv/mod.rs#L63</a></p>



<a name="215018645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215018645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215018645">(Oct 29 2020 at 19:49)</a>:</h4>
<p>so we can filter beforehand and avoid cycling</p>



<a name="215018794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215018794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215018794">(Oct 29 2020 at 19:50)</a>:</h4>
<p>the question I have is what should be done with <code>assoc_name</code> in this case <a href="https://github.com/rust-lang/rust/blob/2a71e45411881dda12a704d7491428d8a23347c0/compiler/rustc_typeck/src/collect.rs#L311">https://github.com/rust-lang/rust/blob/2a71e45411881dda12a704d7491428d8a23347c0/compiler/rustc_typeck/src/collect.rs#L311</a> ?</p>



<a name="215019126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215019126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215019126">(Oct 29 2020 at 19:53)</a>:</h4>
<p>I'm not sure if we want to filter there and I was contemplating passing handling this with an <code>Option&lt;Ident&gt;</code> and pass <code>None</code> in that case</p>



<a name="215035290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215035290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215035290">(Oct 29 2020 at 22:14)</a>:</h4>
<p>so that would help with the case that I mentioned where you have</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">type</span> <span class="nc">Item</span><span class="p">;</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Bar</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">fn</span> <span class="nf">baz</span><span class="o">&lt;</span><span class="n">A</span><span class="o">&gt;</span><span class="p">()</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="n">A</span>: <span class="nc">Foo</span><span class="p">,</span><span class="w"> </span><span class="n">A</span>: <span class="nc">Bar</span><span class="o">&lt;</span><span class="n">A</span>::<span class="n">Item</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="215035340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215035340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215035340">(Oct 29 2020 at 22:14)</a>:</h4>
<p>I kind of think it's worth doing both but admittedly this case is much more niche</p>



<a name="215035364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215035364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215035364">(Oct 29 2020 at 22:14)</a>:</h4>
<p>still I was suggesting that you might want to start with the <code>where A: Foo, A: Bar&lt;A::Item&gt;</code> case instead because it'll be a bit more "contained" (although it's ultimately fairly orthogonal)</p>



<a name="215035419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215035419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215035419">(Oct 29 2020 at 22:15)</a>:</h4>
<p>you're going to have to add a <code>super_traits_that_define_assoc_item</code> query similar to <code>get_type_parameter_bounds</code></p>



<a name="215372632"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215372632" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215372632">(Nov 02 2020 at 20:18)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> do you remember that you told me to filter this <a href="https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_typeck/src/astconv/mod.rs#L1305">https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_typeck/src/astconv/mod.rs#L1305</a> before so we can reduce the code in the elaboration</p>



<a name="215372639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215372639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215372639">(Nov 02 2020 at 20:18)</a>:</h4>
<p>like</p>



<a name="215372664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215372664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215372664">(Nov 02 2020 at 20:18)</a>:</h4>
<p>we could just stick to this <a href="https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_infer/src/traits/util.rs#L131-L152">https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_infer/src/traits/util.rs#L131-L152</a> part</p>



<a name="215372667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215372667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215372667">(Nov 02 2020 at 20:18)</a>:</h4>
<p>but</p>



<a name="215372704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215372704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215372704">(Nov 02 2020 at 20:19)</a>:</h4>
<p>we also have <a href="https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_infer/src/traits/util.rs#L182-L244">https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_infer/src/traits/util.rs#L182-L244</a></p>



<a name="215372750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215372750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215372750">(Nov 02 2020 at 20:19)</a>:</h4>
<p>so I'm not sure if I got you right or if it was that you thought that in the match the only useful thing we were doing was about <code>ty::PredicateAtom::Trait</code></p>



<a name="215381571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215381571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215381571">(Nov 02 2020 at 21:29)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/215372632">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> do you remember that you told me to filter this...</p>
</blockquote>
<p>I did but I think that won't work</p>



<a name="215381659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215381659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215381659">(Nov 02 2020 at 21:30)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/215372704">said</a>:</p>
<blockquote>
<p>we also have <a href="https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_infer/src/traits/util.rs#L182-L244">https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_infer/src/traits/util.rs#L182-L244</a></p>
</blockquote>
<p>this logic is not needed for this particular caller</p>



<a name="215381703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215381703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215381703">(Nov 02 2020 at 21:30)</a>:</h4>
<p>so actually <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> maybe step one, if you wanted, to fixing this bug would be to make a specialized version of "elaborate predicates" that <em>just</em> handles <code>TraitRef</code> (not arbitrary predicates) and <em>just</em> does super-trait expansion</p>



<a name="215382197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215382197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215382197">(Nov 02 2020 at 21:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/215381659">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/215372704">said</a>:</p>
<blockquote>
<p>we also have <a href="https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_infer/src/traits/util.rs#L182-L244">https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_infer/src/traits/util.rs#L182-L244</a></p>
</blockquote>
<p>this logic is not needed for this particular caller</p>
</blockquote>
<p>yeah I know that is not needed, I guess I got what you proposed me in a wrong way :)</p>



<a name="215382240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215382240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215382240">(Nov 02 2020 at 21:35)</a>:</h4>
<p>my understanding was that you wanted me to refactor the code so elaborates takes only <code>ty::PredicateAtom::Trait</code></p>



<a name="215382275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215382275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215382275">(Nov 02 2020 at 21:35)</a>:</h4>
<p>but now I guess that you didn't meant that</p>



<a name="215382390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215382390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215382390">(Nov 02 2020 at 21:36)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/215381703">said</a>:</p>
<blockquote>
<p>so actually <span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> maybe step one, if you wanted, to fixing this bug would be to make a specialized version of "elaborate predicates" that <em>just</em> handles <code>TraitRef</code> (not arbitrary predicates) and <em>just</em> does super-trait expansion</p>
</blockquote>
<p>right, so we can do a elaborate predicates for <code>TraitRef</code> and in our case call that thing</p>



<a name="215382401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215382401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215382401">(Nov 02 2020 at 21:36)</a>:</h4>
<p>yeah, I think that's a good idea</p>



<a name="215382446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215382446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215382446">(Nov 02 2020 at 21:37)</a>:</h4>
<p>and I guess you meant to leave the current elaborate predicates as is</p>



<a name="215382457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215382457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215382457">(Nov 02 2020 at 21:37)</a>:</h4>
<p>just make a new one for this case that takes <code>TraitRef</code></p>



<a name="215382497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215382497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215382497">(Nov 02 2020 at 21:37)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/215382275">said</a>:</p>
<blockquote>
<p>but now I guess that you didn't meant that</p>
</blockquote>
<p>no, I did not mean that</p>



<a name="215382525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215382525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215382525">(Nov 02 2020 at 21:37)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/215382457">said</a>:</p>
<blockquote>
<p>just make a new one for this case that takes <code>TraitRef</code></p>
</blockquote>
<p>right, basically inline that logic into a special-cased function</p>



<a name="215382585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215382585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215382585">(Nov 02 2020 at 21:38)</a>:</h4>
<p>and then the function will grow to take the associated item name</p>



<a name="215382587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215382587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215382587">(Nov 02 2020 at 21:38)</a>:</h4>
<p>and to use a distinct query</p>



<a name="215382590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215382590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215382590">(Nov 02 2020 at 21:38)</a>:</h4>
<p>so as to avoid cycles</p>



<a name="215483219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215483219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215483219">(Nov 03 2020 at 17:12)</a>:</h4>
<p>I'm having troubles to pass the assoc_name (<code>Ident</code>) down</p>



<a name="215483271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215483271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215483271">(Nov 03 2020 at 17:12)</a>:</h4>
<p>we've said we should pass it here <a href="https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_typeck/src/astconv/mod.rs#L1295">https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_typeck/src/astconv/mod.rs#L1295</a></p>



<a name="215483298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215483298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215483298">(Nov 03 2020 at 17:12)</a>:</h4>
<p>and here <a href="https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_typeck/src/astconv/mod.rs#L1305">https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_typeck/src/astconv/mod.rs#L1305</a></p>



<a name="215483445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215483445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215483445">(Nov 03 2020 at 17:14)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/215483271">said</a>:</p>
<blockquote>
<p>we've said we should pass it here <a href="https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_typeck/src/astconv/mod.rs#L1295">https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_typeck/src/astconv/mod.rs#L1295</a></p>
</blockquote>
<p>if I pass the thing down here, <a href="https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_typeck/src/collect.rs#L314">https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_typeck/src/collect.rs#L314</a> too</p>



<a name="215483507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215483507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215483507">(Nov 03 2020 at 17:14)</a>:</h4>
<p>and that's a Query</p>



<a name="215483531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215483531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215483531">(Nov 03 2020 at 17:14)</a>:</h4>
<p>so I need to pass <code>Indent</code> as part of the key</p>



<a name="215483575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215483575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215483575">(Nov 03 2020 at 17:15)</a>:</h4>
<p>at that point I get</p>



<a name="215483578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215483578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215483578">(Nov 03 2020 at 17:15)</a>:</h4>
<div class="codehilite"><pre><span></span><code>|| 346  | |          $(impl&lt;$tcx&gt; QueryConfig for queries::$name&lt;$tcx&gt; {
||      | |                       ^^^^^^^^^^^ the trait `keys::Key` is not implemented for `(rustc_hir::def_id::DefId, rustc_hir::def_id::LocalDefId, rustc_span::symbol::Ident)`
</code></pre></div>



<a name="215483610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215483610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215483610">(Nov 03 2020 at 17:15)</a>:</h4>
<p>I'm not sure if I should follow this path</p>



<a name="215484207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215484207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215484207">(Nov 03 2020 at 17:20)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="215485227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215485227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cjgillot <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215485227">(Nov 03 2020 at 17:27)</a>:</h4>
<p>For the <code>keys::Key</code> trait is implemented in <code>rustc_middle::ty::query::keys</code>. New impls are okay AFAIK.</p>



<a name="215489202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215489202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215489202">(Nov 03 2020 at 17:57)</a>:</h4>
<p>yeah, saw that anyway good to know, was mainly wondering if the path I was taking was ok</p>



<a name="215498854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215498854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215498854">(Nov 03 2020 at 19:19)</a>:</h4>
<p>now I was considering how to filter based on the associated type name</p>



<a name="215498886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215498886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215498886">(Nov 03 2020 at 19:19)</a>:</h4>
<p>I guess I need something like</p>



<a name="215499012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215499012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215499012">(Nov 03 2020 at 19:20)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="bp">self</span><span class="p">.</span><span class="n">tcx</span><span class="p">.</span><span class="n">associated_items</span><span class="p">(</span><span class="n">trait_did</span><span class="p">).</span><span class="n">filter_by_name</span><span class="p">(</span><span class="n">ident</span><span class="p">.</span><span class="n">name</span><span class="p">)</span><span class="w"></span>
</code></pre></div>



<a name="215503759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215503759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215503759">(Nov 03 2020 at 20:05)</a>:</h4>
<p>ended filtering like</p>



<a name="215503762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215503762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215503762">(Nov 03 2020 at 20:05)</a>:</h4>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code>                 self.param_env.caller_bounds().iter().filter_map(|predicate| {
                     match predicate.skip_binders() {
                         ty::PredicateAtom::Trait(data, _) if data.self_ty().is_param(index) =&gt; {
<span class="gd">-                            // HACK(eddyb) should get the original `Span`.</span>
<span class="gd">-                            let span = tcx.def_span(def_id);</span>
<span class="gd">-                            Some((predicate, span))</span>
<span class="gi">+                            let trait_did = data.def_id();</span>
<span class="gi">+                            if tcx</span>
<span class="gi">+                                .associated_items(trait_did)</span>
<span class="gi">+                                .filter_by_name_unhygienic(assoc_name.name)</span>
<span class="gi">+                                .next()</span>
<span class="gi">+                                .is_some()</span>
<span class="gi">+                            {</span>
<span class="gi">+                                // HACK(eddyb) should get the original `Span`.</span>
<span class="gi">+                                let span = tcx.def_span(def_id);</span>
<span class="gi">+                                Some((predicate, span))</span>
<span class="gi">+                            } else {</span>
<span class="gi">+                                None</span>
<span class="gi">+                            }</span>
                         }
                         _ =&gt; None,
                     }
</code></pre></div>



<a name="215503766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215503766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215503766">(Nov 03 2020 at 20:05)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="215503884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215503884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215503884">(Nov 03 2020 at 20:06)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> you will have to add it to the query key, for better or worse</p>



<a name="215503917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215503917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215503917">(Nov 03 2020 at 20:06)</a>:</h4>
<p>howevr</p>



<a name="215503929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215503929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215503929">(Nov 03 2020 at 20:06)</a>:</h4>
<p>let me push because I already did that</p>



<a name="215503930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215503930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215503930">(Nov 03 2020 at 20:06)</a>:</h4>
<p>couple of things</p>



<a name="215503950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215503950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215503950">(Nov 03 2020 at 20:06)</a>:</h4>
<p>first, there are kind of three changes we've discussed</p>



<a name="215503979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215503979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215503979">(Nov 03 2020 at 20:07)</a>:</h4>
<ul>
<li>a pure refactoring to make a specialized version of "elaborate predicates" for use in <a href="https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_typeck/src/astconv/mod.rs#L1301-L1307">this code</a></li>
</ul>



<a name="215504032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215504032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215504032">(Nov 03 2020 at 20:07)</a>:</h4>
<ul>
<li>extending that specialized "elaborate" code to take the associated item name and making a modified <code>supertraits_of</code> query that takes the associated item name, and only returns supertraits that may potentially define that associated item</li>
</ul>



<a name="215504034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215504034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215504034">(Nov 03 2020 at 20:07)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <a href="https://github.com/rust-lang/rust/compare/master...spastorino:trait-inheritance-self">https://github.com/rust-lang/rust/compare/master...spastorino:trait-inheritance-self</a></p>



<a name="215504113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215504113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215504113">(Nov 03 2020 at 20:08)</a>:</h4>
<ul>
<li>modifying the <a href="https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_typeck/src/astconv/mod.rs#L1295">get_type_parameter_bounds call</a> to also track the associated item name; this isn't really relevant to the original bug, more to a related bug with where clauses that generate unnecessary ambiguity</li>
</ul>



<a name="215504138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215504138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215504138">(Nov 03 2020 at 20:08)</a>:</h4>
<p>yeah I'm still tackling not the <code>Self</code> problem but the one where <code>Self</code> was not used</p>



<a name="215504163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215504163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215504163">(Nov 03 2020 at 20:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/215504113">said</a>:</p>
<blockquote>
<ul>
<li>modifying the <a href="https://github.com/rust-lang/rust/blob/499ebcfdf3b09a646154f321b7c28f5105e4dbf7/compiler/rustc_typeck/src/astconv/mod.rs#L1295">get_type_parameter_bounds call</a> to also track the associated item name; this isn't really relevant to the original bug, more to a related bug with where clauses that generate unnecessary ambiguity</li>
</ul>
</blockquote>
<p>this part is what I'm currently trying to do</p>



<a name="215504182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215504182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215504182">(Nov 03 2020 at 20:09)</a>:</h4>
<p>so I'm still not adding a new query or anything like that</p>



<a name="215504213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215504213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215504213">(Nov 03 2020 at 20:09)</a>:</h4>
<p>I guess in my code this is not the way to filter <a href="https://github.com/rust-lang/rust/compare/master...spastorino:trait-inheritance-self#diff-0b3760aae48c64fee635939113df3d4440ea809c6a44f9d3a7bf108626c9c8e9R205-R210">https://github.com/rust-lang/rust/compare/master...spastorino:trait-inheritance-self#diff-0b3760aae48c64fee635939113df3d4440ea809c6a44f9d3a7bf108626c9c8e9R205-R210</a></p>



<a name="215504296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215504296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215504296">(Nov 03 2020 at 20:10)</a>:</h4>
<p>but I'm not sure need to investigate a bit more what <code>associated_items</code> return given a <code>trait_did</code></p>



<a name="215505586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215505586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215505586">(Nov 03 2020 at 20:22)</a>:</h4>
<p>well what I'm doing is actually what <code>trait_defines_associated_type_named</code> does</p>



<a name="215509452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215509452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215509452">(Nov 03 2020 at 21:01)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> this looks like a plausible fix for that problem, at least in some instances</p>



<a name="215509580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215509580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215509580">(Nov 03 2020 at 21:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> when you say <code>this</code> what did you meant?</p>



<a name="215509610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215509610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215509610">(Nov 03 2020 at 21:02)</a>:</h4>
<p>what I've done doesn't work</p>



<a name="215512443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215512443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215512443">(Nov 03 2020 at 21:29)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> I meant your PR</p>



<a name="215512455"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215512455" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215512455">(Nov 03 2020 at 21:29)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> well, that diff. In what way does it not work?</p>



<a name="215512466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215512466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215512466">(Nov 03 2020 at 21:29)</a>:</h4>
<p>I didn't dig too closely into it, I just meant that it's a kind of "sketch in the right direction"</p>



<a name="215512474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215512474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215512474">(Nov 03 2020 at 21:29)</a>:</h4>
<p>does it still get a cycle error?</p>



<a name="215522698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215522698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215522698">(Nov 03 2020 at 23:11)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/215512474">said</a>:</p>
<blockquote>
<p>does it still get a cycle error?</p>
</blockquote>
<p>yes I did :)</p>



<a name="215584421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215584421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215584421">(Nov 04 2020 at 14:06)</a>:</h4>
<p>Hmm <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> maybe the best next step is for me to check it out</p>



<a name="215584458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215584458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215584458">(Nov 04 2020 at 14:07)</a>:</h4>
<p>I guess I didn't look that closely at the diff so there might be some tweak required to evade the cycle error</p>



<a name="215584471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215584471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215584471">(Nov 04 2020 at 14:07)</a>:</h4>
<p>but it'd also be useful to see the backtrace</p>



<a name="215584673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215584673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215584673">(Nov 04 2020 at 14:08)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> let me create a gist</p>



<a name="215584722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215584722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215584722">(Nov 04 2020 at 14:09)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <a href="https://gist.github.com/spastorino/f23b54d995507b854370ecf9013f66c9">https://gist.github.com/spastorino/f23b54d995507b854370ecf9013f66c9</a></p>



<a name="215584791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215584791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215584791">(Nov 04 2020 at 14:09)</a>:</h4>
<p>the example being compiled is</p>



<a name="215584793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215584793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215584793">(Nov 04 2020 at 14:09)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">Item</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">trait</span><span class="w"> </span><span class="n">Bar</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="c1">//trait Baz: Foo + Bar&lt;Self::Item&gt; {}</span>

<span class="k">fn</span> <span class="nf">baz</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="p">()</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="n">T</span>: <span class="nc">Foo</span><span class="p">,</span><span class="w"> </span><span class="n">T</span>: <span class="nc">Bar</span><span class="o">&lt;</span><span class="n">T</span>::<span class="n">Item</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>



<a name="215585990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215585990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215585990">(Nov 04 2020 at 14:17)</a>:</h4>
<p>ok <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> well from looking at the code</p>



<a name="215586031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215586031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215586031">(Nov 04 2020 at 14:18)</a>:</h4>
<p>I believe the problem is that you didn't finish modifying <code>type_param_predicates</code></p>



<a name="215586080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215586080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215586080">(Nov 04 2020 at 14:18)</a>:</h4>
<p>you have given it an <code>assoc_name</code></p>



<a name="215586089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215586089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215586089">(Nov 04 2020 at 14:18)</a>:</h4>
<p>but you're not really <em>using</em> it anywhere</p>



<a name="215586097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215586097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215586097">(Nov 04 2020 at 14:18)</a>:</h4>
<p>in particular:</p>



<a name="215586164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215586164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215586164">(Nov 04 2020 at 14:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/215504213">said</a>:</p>
<blockquote>
<p>I guess in my code this is not the way to filter <a href="https://github.com/rust-lang/rust/compare/master...spastorino:trait-inheritance-self#diff-0b3760aae48c64fee635939113df3d4440ea809c6a44f9d3a7bf108626c9c8e9R205-R210">https://github.com/rust-lang/rust/compare/master...spastorino:trait-inheritance-self#diff-0b3760aae48c64fee635939113df3d4440ea809c6a44f9d3a7bf108626c9c8e9R205-R210</a></p>
</blockquote>
<p>this function is not relevant, this is the implementation in the <code>FnCtxt</code> and that comes too late</p>



<a name="215586216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215586216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215586216">(Nov 04 2020 at 14:19)</a>:</h4>
<p>what you are interested in is this implementation from <code>collect.rs</code>:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">    </span><span class="k">fn</span> <span class="nf">get_type_parameter_bounds</span><span class="p">(</span><span class="w"></span>
<span class="w">        </span><span class="o">&amp;</span><span class="bp">self</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">span</span>: <span class="nc">Span</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">def_id</span>: <span class="nc">DefId</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">assoc_name</span>: <span class="nc">Ident</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">ty</span>::<span class="n">GenericPredicates</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="bp">self</span><span class="p">.</span><span class="n">tcx</span><span class="p">.</span><span class="n">at</span><span class="p">(</span><span class="n">span</span><span class="p">).</span><span class="n">type_param_predicates</span><span class="p">((</span><span class="w"></span>
<span class="w">            </span><span class="bp">self</span><span class="p">.</span><span class="n">item_def_id</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="n">def_id</span><span class="p">.</span><span class="n">expect_local</span><span class="p">(),</span><span class="w"></span>
<span class="w">            </span><span class="n">assoc_name</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="p">))</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="215586253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215586253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215586253">(Nov 04 2020 at 14:19)</a>:</h4>
<p>and you can see that it invokes the <code>type_param_predicates</code> query</p>



<a name="215586370"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215586370" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215586370">(Nov 04 2020 at 14:20)</a>:</h4>
<p><a href="https://github.com/spastorino/rust/blob/0e0c50e05144df920560a7146a591a22245d66d9/compiler/rustc_typeck/src/collect.rs#L500-L505">definition here</a></p>



<a name="215586408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215586408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215586408">(Nov 04 2020 at 14:20)</a>:</h4>
<p><a href="https://github.com/spastorino/rust/blob/0e0c50e05144df920560a7146a591a22245d66d9/compiler/rustc_typeck/src/collect.rs#L570-L578">this loop I think is where the cycle arises</a></p>



<a name="215586524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215586524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215586524">(Nov 04 2020 at 14:21)</a>:</h4>
<p><a href="https://github.com/spastorino/rust/blob/0e0c50e05144df920560a7146a591a22245d66d9/compiler/rustc_typeck/src/collect.rs#L585-L595">this function</a> probably needs to take <code>assoc_name</code> and it needs to be modified so that</p>



<a name="215586580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215586580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215586580">(Nov 04 2020 at 14:21)</a>:</h4>
<p>given a HIR predicate <code>T: Foo</code>, it only tries to convert that into a <code>ty</code> predicate <em>if</em> the trait <code>Foo</code> defines <code>assoc_name</code></p>



<a name="215586602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215586602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215586602">(Nov 04 2020 at 14:21)</a>:</h4>
<p>it is that conversion that creates the cycle</p>



<a name="215586613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215586613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215586613">(Nov 04 2020 at 14:21)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="215642110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215642110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215642110">(Nov 04 2020 at 21:14)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> facepalm, yeah I see :)</p>



<a name="215882764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215882764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215882764">(Nov 06 2020 at 18:08)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <a href="https://github.com/rust-lang/rust/compare/master...spastorino:trait-inheritance-self">https://github.com/rust-lang/rust/compare/master...spastorino:trait-inheritance-self</a></p>



<a name="215882792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215882792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215882792">(Nov 06 2020 at 18:08)</a>:</h4>
<p>still is not working but was just wondering if that's what more or less you wanted to do</p>



<a name="215883130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215883130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215883130">(Nov 06 2020 at 18:11)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> that does look like the general idea, though I think this is wrong:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="n">trait_did</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">tcx</span><span class="p">.</span><span class="n">hir</span><span class="p">().</span><span class="n">local_def_id</span><span class="p">(</span><span class="n">param_id</span><span class="p">).</span><span class="n">to_def_id</span><span class="p">();</span><span class="w"></span>
</code></pre></div>



<a name="215883141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215883141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215883141">(Nov 06 2020 at 18:11)</a>:</h4>
<p>I think that is the id of the type parameter, not the trait?</p>



<a name="215883193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215883193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215883193">(Nov 06 2020 at 18:12)</a>:</h4>
<p>that's probably right :)</p>



<a name="215883202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215883202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215883202">(Nov 06 2020 at 18:12)</a>:</h4>
<p>I'm pretty sure I'm using a wrong id somewhere</p>



<a name="215883208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215883208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215883208">(Nov 06 2020 at 18:12)</a>:</h4>
<p>probably that one :)</p>



<a name="215883213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215883213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215883213">(Nov 06 2020 at 18:12)</a>:</h4>
<p>checking ...</p>



<a name="215884846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215884846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215884846">(Nov 06 2020 at 18:25)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> yeah, that's right</p>



<a name="215884867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215884867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215884867">(Nov 06 2020 at 18:25)</a>:</h4>
<p>this is not the id I'm looking for</p>



<a name="215885005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215885005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215885005">(Nov 06 2020 at 18:26)</a>:</h4>
<div class="message_inline_image"><a href="https://i.kym-cdn.com/entries/icons/mobile/000/018/682/obi-wan.jpg"><img src="https://i.kym-cdn.com/entries/icons/mobile/000/018/682/obi-wan.jpg"></a></div>



<a name="215885100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215885100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215885100">(Nov 06 2020 at 18:27)</a>:</h4>
<p>hehehe, don't remember what happens in that scene :)</p>



<a name="215885120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215885120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215885120">(Nov 06 2020 at 18:27)</a>:</h4>
<p>"not the droids you're looking for"</p>



<a name="215885134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215885134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215885134">(Nov 06 2020 at 18:27)</a>:</h4>
<p>:)</p>



<a name="215885153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215885153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215885153">(Nov 06 2020 at 18:27)</a>:</h4>
<p>I guess that comes on <code>generics</code> arg</p>



<a name="215885211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215885211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215885211">(Nov 06 2020 at 18:27)</a>:</h4>
<p>the id you want is going to come from the <em>name</em> of the trait I think</p>



<a name="215885217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215885217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215885217">(Nov 06 2020 at 18:27)</a>:</h4>
<p>it might be a bit tricky to find :/</p>



<a name="215885246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215885246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215885246">(Nov 06 2020 at 18:28)</a>:</h4>
<p>have to look at the HIR structures</p>



<a name="215885326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215885326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215885326">(Nov 06 2020 at 18:28)</a>:</h4>
<p>yeah isn't the parent of what comes in generics?</p>



<a name="215890263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215890263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215890263">(Nov 06 2020 at 19:07)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> it seems that <code>ItemCtxt</code> holds a reference to the trait</p>



<a name="215890331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215890331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215890331">(Nov 06 2020 at 19:08)</a>:</h4>
<p>was trying ...</p>



<a name="215890332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215890332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215890332">(Nov 06 2020 at 19:08)</a>:</h4>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code><span class="gu">@@ -635,16 +634,15 @@ impl ItemCtxt&lt;'tcx&gt; {</span>
             .iter()
             .filter_map(|wp| match *wp {
                 hir::WherePredicate::BoundPredicate(ref bp) =&gt; {
<span class="gd">-                    let trait_did = self.tcx.hir().local_def_id(param_id).to_def_id();</span>
                     if assoc_name.is_none()
                         || self
                             .tcx
<span class="gd">-                            .associated_items(trait_did)</span>
<span class="gi">+                            .associated_items(self.item_def_id)</span>
                             .find_by_name_and_kind(
                                 self.tcx,
                                 assoc_name.unwrap(),
                                 ty::AssocKind::Type,
<span class="gd">-                                trait_did,</span>
<span class="gi">+                                self.item_def_id,</span>
                             )
                             .is_some()
                     {
</code></pre></div>



<a name="215890345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215890345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215890345">(Nov 06 2020 at 19:08)</a>:</h4>
<p>doesn't work either :/</p>



<a name="215895935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215895935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215895935">(Nov 06 2020 at 19:54)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> so the <code>bp</code> variable there...</p>



<a name="215895950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215895950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215895950">(Nov 06 2020 at 19:54)</a>:</h4>
<p>this represents "some where clause", basically</p>



<a name="215895977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215895977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215895977">(Nov 06 2020 at 19:55)</a>:</h4>
<p>the <code>bp</code> is a <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/ast/struct.WhereBoundPredicate.html"><code>WhereBoundPredicate</code></a>, I guess</p>



<a name="215896050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896050">(Nov 06 2020 at 19:55)</a>:</h4>
<p>oh this is annoying</p>



<a name="215896120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896120">(Nov 06 2020 at 19:56)</a>:</h4>
<p>so actually <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> I think you're filtering at the wrong spot :)</p>



<a name="215896166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896166">(Nov 06 2020 at 19:56)</a>:</h4>
<p>hmm :)</p>



<a name="215896173"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896173" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896173">(Nov 06 2020 at 19:56)</a>:</h4>
<p><em>almost</em> right</p>



<a name="215896202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896202">(Nov 06 2020 at 19:56)</a>:</h4>
<p>in which of the many filters I'm doing? :P</p>



<a name="215896350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896350">(Nov 06 2020 at 19:57)</a>:</h4>
<p>lol I meant the one <a href="https://github.com/rust-lang/rust/compare/master...spastorino:trait-inheritance-self#diff-ac1e6e554bac799e1e2d3886bea8fdc0d0bf04b20d33df59f5a8e92c41987ac6R656">here</a>, line 656 of <code>collect.rs</code></p>



<a name="215896401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896401">(Nov 06 2020 at 19:58)</a>:</h4>
<p>basically the "bound predicate" is a series of bounds like <code>Foo + Bar</code></p>



<a name="215896458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896458">(Nov 06 2020 at 19:58)</a>:</h4>
<p>i.e., if you have <code>trait Foo: Bar + Baz</code>, it would be the <code>Bar + Baz</code></p>



<a name="215896474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896474">(Nov 06 2020 at 19:58)</a>:</h4>
<p>so we need to filter <em>from within those bounds</em></p>



<a name="215896506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896506">(Nov 06 2020 at 19:58)</a>:</h4>
<p>and this one <a href="https://github.com/rust-lang/rust/compare/master...spastorino:trait-inheritance-self#diff-ac1e6e554bac799e1e2d3886bea8fdc0d0bf04b20d33df59f5a8e92c41987ac6R608">https://github.com/rust-lang/rust/compare/master...spastorino:trait-inheritance-self#diff-ac1e6e554bac799e1e2d3886bea8fdc0d0bf04b20d33df59f5a8e92c41987ac6R608</a> is correct?</p>



<a name="215896623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896623">(Nov 06 2020 at 19:59)</a>:</h4>
<p>the code is kind of annoying but</p>



<a name="215896666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896666">(Nov 06 2020 at 19:59)</a>:</h4>
<p>probably the right spot is actually <em>in</em> the <code>predicates_from_bound</code> function</p>



<a name="215896718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896718">(Nov 06 2020 at 20:00)</a>:</h4>
<p>i.e., you could pass <code>assoc_name</code> to that function</p>



<a name="215896773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896773">(Nov 06 2020 at 20:00)</a>:</h4>
<p>wait</p>



<a name="215896775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896775">(Nov 06 2020 at 20:00)</a>:</h4>
<p>sorry, no</p>



<a name="215896782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896782">(Nov 06 2020 at 20:00)</a>:</h4>
<p>I mean you <em>could</em></p>



<a name="215896789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896789">(Nov 06 2020 at 20:00)</a>:</h4>
<p>but also before you call that function, you could filter</p>



<a name="215896791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896791">(Nov 06 2020 at 20:00)</a>:</h4>
<p>I thought about doing that too</p>



<a name="215896800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896800">(Nov 06 2020 at 20:00)</a>:</h4>
<p>but the point is that this function is processing a single bound</p>



<a name="215896830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896830">(Nov 06 2020 at 20:01)</a>:</h4>
<p>if it represents a TraitBound, you would check if the trait has an assoc item with that name</p>



<a name="215896848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896848">(Nov 06 2020 at 20:01)</a>:</h4>
<p>if not, you would return empty vector</p>



<a name="215896870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896870">(Nov 06 2020 at 20:01)</a>:</h4>
<p>but it might be nicer to pull the filter into a separate function</p>



<a name="215896900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896900">(Nov 06 2020 at 20:01)</a>:</h4>
<p>because I imagine there are more callers of <code>predicates_from_bound</code> and only <em>some</em> want to filter</p>



<a name="215896907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896907">(Nov 06 2020 at 20:01)</a>:</h4>
<p>yeah</p>



<a name="215896940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215896940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215896940">(Nov 06 2020 at 20:01)</a>:</h4>
<p>but you meant to filter on <code>predicates_from_bound</code> or before?</p>



<a name="215897059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215897059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215897059">(Nov 06 2020 at 20:02)</a>:</h4>
<p>I guess you're saying to filter before on a separate function to avoid the repetition you see in the code I've pushed</p>



<a name="215897063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215897063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215897063">(Nov 06 2020 at 20:02)</a>:</h4>
<p>I think you could change it to something like</p>



<a name="215897099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215897099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215897099">(Nov 06 2020 at 20:02)</a>:</h4>
<p>before</p>



<a name="215897105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215897105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215897105">(Nov 06 2020 at 20:03)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">            </span><span class="p">.</span><span class="n">flat_map</span><span class="p">(</span><span class="o">|</span><span class="p">(</span><span class="n">bt</span><span class="p">,</span><span class="w"> </span><span class="n">b</span><span class="p">)</span><span class="o">|</span><span class="w"> </span><span class="n">predicates_from_bound</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">bt</span><span class="p">,</span><span class="w"> </span><span class="n">b</span><span class="p">,</span><span class="w"> </span><span class="n">constness</span><span class="p">));</span><span class="w"></span>
</code></pre></div>



<a name="215897111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215897111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215897111">(Nov 06 2020 at 20:03)</a>:</h4>
<p>after</p>



<a name="215897169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215897169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215897169">(Nov 06 2020 at 20:03)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">            </span><span class="p">.</span><span class="n">filter</span><span class="p">(</span><span class="o">|</span><span class="p">(</span><span class="n">_</span><span class="p">,</span><span class="w"> </span><span class="n">b</span><span class="p">)</span><span class="o">|</span><span class="w"> </span><span class="n">bound_defines_assoc_item</span><span class="p">(</span><span class="n">b</span><span class="p">,</span><span class="w"> </span><span class="n">assoc_name</span><span class="p">))</span><span class="w"></span>
<span class="w">            </span><span class="p">.</span><span class="n">flat_map</span><span class="p">(</span><span class="o">|</span><span class="p">(</span><span class="n">bt</span><span class="p">,</span><span class="w"> </span><span class="n">b</span><span class="p">)</span><span class="o">|</span><span class="w"> </span><span class="n">predicates_from_bound</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">bt</span><span class="p">,</span><span class="w"> </span><span class="n">b</span><span class="p">,</span><span class="w"> </span><span class="n">constness</span><span class="p">));</span><span class="w"></span>
</code></pre></div>



<a name="215897221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215897221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215897221">(Nov 06 2020 at 20:03)</a>:</h4>
<p>I am a <em>bit</em> hesitant before because the <code>bt</code> type is produced by calling <code>self.to_ty</code> and <em>that</em> can also cause cycles, but it's a good start</p>



<a name="215897304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215897304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215897304">(Nov 06 2020 at 20:04)</a>:</h4>
<p>(also that is dependent on a flag and I haven't looked to see what value that flag would have)</p>



<a name="215898766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215898766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215898766">(Nov 06 2020 at 20:17)</a>:</h4>
<p>ok, going to check this</p>



<a name="215904864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215904864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215904864">(Nov 06 2020 at 21:13)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> just in case</p>



<a name="215904883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215904883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215904883">(Nov 06 2020 at 21:13)</a>:</h4>
<p>do we want to do this for both, params and where_clases, right?</p>



<a name="215907099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215907099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215907099">(Nov 06 2020 at 21:36)</a>:</h4>
<p>nevermind I see</p>



<a name="215922104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215922104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215922104">(Nov 07 2020 at 00:45)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> gave another quick pass <a href="https://github.com/rust-lang/rust/compare/master...spastorino:trait-inheritance-self">https://github.com/rust-lang/rust/compare/master...spastorino:trait-inheritance-self</a></p>



<a name="215922106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215922106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215922106">(Nov 07 2020 at 00:45)</a>:</h4>
<p>but it doesn't compile :/</p>



<a name="215923299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215923299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215923299">(Nov 07 2020 at 01:06)</a>:</h4>
<p>I'm probably doing a mess in <code>bound_defines_assoc_item</code> with the ids</p>



<a name="215959396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215959396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215959396">(Nov 07 2020 at 15:17)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> the problem I think</p>



<a name="215959397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215959397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215959397">(Nov 07 2020 at 15:17)</a>:</h4>
<p>is that <code>bound_defines_assoc_item</code> doesn't consider supertraits</p>



<a name="215959403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215959403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215959403">(Nov 07 2020 at 15:18)</a>:</h4>
<p>this is gonna be just a <em>touch</em> tricky</p>



<a name="215959444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215959444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215959444">(Nov 07 2020 at 15:18)</a>:</h4>
<p>we need something that enumerates supertraits just by def-ids</p>



<a name="215959445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/215959445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#215959445">(Nov 07 2020 at 15:18)</a>:</h4>
<p>without converting all the types within</p>



<a name="216405576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216405576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216405576">(Nov 11 2020 at 22:19)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> ok so the supertrait problem ...</p>



<a name="216405648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216405648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216405648">(Nov 11 2020 at 22:20)</a>:</h4>
<p>so if you have <code>trait Foo: Bar&lt;Self::X&gt; + Baz</code>, we want (when evaluating <code>Self::X</code>...) to be able to ignore <code>Bar</code>. The problem is that <code>elaborate_predicates</code> is going to invoke <code>superpredicates_of</code> or something, which will not ignore the <code>Bar</code> bound.</p>



<a name="216405660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216405660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216405660">(Nov 11 2020 at 22:20)</a>:</h4>
<p>so we need a variant of <code>superprediates_of</code> that takes the associated item name</p>



<a name="216405669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216405669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216405669">(Nov 11 2020 at 22:20)</a>:</h4>
<p>e.g. <code>superpredicates_that_define_assoc_type</code></p>



<a name="216405691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216405691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216405691">(Nov 11 2020 at 22:21)</a>:</h4>
<p>and then we need a variation of <code>elaborate_predicates</code> that uses this</p>



<a name="216405696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216405696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216405696">(Nov 11 2020 at 22:21)</a>:</h4>
<p>I imagine something like this</p>



<a name="216405849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216405849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216405849">(Nov 11 2020 at 22:22)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">elaborate_trait_ref_that_define_assoc_type</span><span class="p">(</span><span class="n">trait_ref</span>: <span class="nc">TraitRef</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">type_name</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="c1">// specialize to trait ref</span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">stack</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">vec</span><span class="o">!</span><span class="p">[</span><span class="n">x</span><span class="p">];</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">vec</span><span class="o">!</span><span class="p">[];</span><span class="w"></span>
<span class="w">    </span><span class="k">while</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">trait_ref</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">.</span><span class="n">pop</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="n">result</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="n">trait_ref</span><span class="p">);</span><span class="w"></span>
<span class="w">        </span><span class="n">stack</span><span class="p">.</span><span class="n">extend</span><span class="p">(</span><span class="n">tcx</span><span class="p">.</span><span class="n">super_predicates_that_define_assoc_type</span><span class="p">(</span><span class="n">trait_Ref</span><span class="p">,</span><span class="w"> </span><span class="n">type_name</span><span class="p">));</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="216405865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216405865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216405865">(Nov 11 2020 at 22:22)</a>:</h4>
<p>my point was that because, for our purposes, we only care about a limited subset of predicates</p>



<a name="216405877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216405877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216405877">(Nov 11 2020 at 22:22)</a>:</h4>
<p>we can ignore most of the cases and write more specialized code</p>



<a name="216508464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216508464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216508464">(Nov 12 2020 at 18:29)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> <a href="https://hackmd.io/6zYx-fjzRbiLFue68Xrv7A">hackmd for notes</a></p>



<a name="216630097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216630097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Arlie Davis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216630097">(Nov 13 2020 at 15:52)</a>:</h4>
<p>[oops, wrong stream]</p>



<a name="216725506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725506">(Nov 14 2020 at 12:06)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> btw have you pushed your latest changes?</p>



<a name="216725510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725510">(Nov 14 2020 at 12:06)</a>:</h4>
<p>yes</p>



<a name="216725514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725514">(Nov 14 2020 at 12:06)</a>:</h4>
<p>well I have a local change</p>



<a name="216725516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725516">(Nov 14 2020 at 12:06)</a>:</h4>
<p>let me push that too</p>



<a name="216725532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725532">(Nov 14 2020 at 12:07)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> done</p>



<a name="216725545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725545">(Nov 14 2020 at 12:07)</a>:</h4>
<p>using a particular example, one of the things that are failing</p>



<a name="216725546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725546">(Nov 14 2020 at 12:07)</a>:</h4>
<p>let me pull</p>



<a name="216725551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725551">(Nov 14 2020 at 12:07)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/3461325d239ac7804ee6249ffa7d9dccae70c298/library/core/src/iter/adapters/flatten.rs#L80-L84">https://github.com/rust-lang/rust/blob/3461325d239ac7804ee6249ffa7d9dccae70c298/library/core/src/iter/adapters/flatten.rs#L80-L84</a></p>



<a name="216725595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725595">(Nov 14 2020 at 12:08)</a>:</h4>
<p>it's failing for this case <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="216725596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725596">(Nov 14 2020 at 12:08)</a>:</h4>
<p>with ...</p>



<a name="216725603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725603">(Nov 14 2020 at 12:08)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error[E0221]: ambiguous associated type `Item` in bounds of `I`
   --&gt; library/core/src/iter/adapters/flatten.rs:82:14
    |
82  |     F: FnMut(I::Item) -&gt; U,
    |              ^^^^^^^ ambiguous associated type `Item`
    |
   ::: library/core/src/iter/traits/iterator.rs:100:5
    |
100 |     type Item;
    |     ----------
    |     |
    |     ambiguous `Item` from `Iterator`
    |     ambiguous `Item` from `Iterator`
    |
help: use fully qualified syntax to disambiguate
    |
82  |     F: FnMut(&lt;I as Iterator&gt;::Item) -&gt; U,
    |              ^^^^^^^^^^^^^^^^^^^^^
help: use fully qualified syntax to disambiguate
    |
82  |     F: FnMut(&lt;I as Iterator&gt;::Item) -&gt; U,
    |              ^^^^^^^^^^^^^^^^^^^^^
</code></pre></div>



<a name="216725604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725604">(Nov 14 2020 at 12:08)</a>:</h4>
<p>ah</p>



<a name="216725613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725613">(Nov 14 2020 at 12:08)</a>:</h4>
<p>that's not the case I thought it was failing with</p>



<a name="216725619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725619">(Nov 14 2020 at 12:09)</a>:</h4>
<p>from my debug prints I see ...</p>



<a name="216725622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725622">(Nov 14 2020 at 12:09)</a>:</h4>
<div class="codehilite"><pre><span></span><code>2:rustc[1;34mDEBUG[0m [2mrustc_infer::traits::util[0m super_predicates: data=TraitPredicate(&lt;I as iter::traits::double_ended::DoubleEndedIterator&gt;)
2:rustc[1;34mDEBUG[0m [2mrustc_infer::traits::util[0m super_predicates: data=TraitPredicate(&lt;I as iter::traits::iterator::Iterator&gt;)
</code></pre></div>



<a name="216725632"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725632" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725632">(Nov 14 2020 at 12:09)</a>:</h4>
<p>so I was saying that we should just consider <code>DoubleEndedIterator</code> and not both of them</p>



<a name="216725965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725965">(Nov 14 2020 at 12:19)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> sorry had to step away</p>



<a name="216725967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216725967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216725967">(Nov 14 2020 at 12:19)</a>:</h4>
<p>mmm</p>



<a name="216726011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726011">(Nov 14 2020 at 12:20)</a>:</h4>
<p>so the thing is that <code>DoubleEndedIterator</code> <em>extends</em> <code>Iterator</code></p>



<a name="216726016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726016">(Nov 14 2020 at 12:20)</a>:</h4>
<p>I guess that I can stop here <a href="https://github.com/rust-lang/rust/blob/3461325d239ac7804ee6249ffa7d9dccae70c298/compiler/rustc_infer/src/traits/util.rs#L104">https://github.com/rust-lang/rust/blob/3461325d239ac7804ee6249ffa7d9dccae70c298/compiler/rustc_infer/src/traits/util.rs#L104</a></p>



<a name="216726019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726019">(Nov 14 2020 at 12:20)</a>:</h4>
<p>I don't think that considering both of them is a problem, but somewhere there should be a de-duplication that occurs</p>



<a name="216726027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726027">(Nov 14 2020 at 12:21)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/216726016">said</a>:</p>
<blockquote>
<p>I guess that I can stop here <a href="https://github.com/rust-lang/rust/blob/3461325d239ac7804ee6249ffa7d9dccae70c298/compiler/rustc_infer/src/traits/util.rs#L104">https://github.com/rust-lang/rust/blob/3461325d239ac7804ee6249ffa7d9dccae70c298/compiler/rustc_infer/src/traits/util.rs#L104</a></p>
</blockquote>
<p>I meant, not call super if this particular trait defines assoc_name</p>



<a name="216726032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726032">(Nov 14 2020 at 12:21)</a>:</h4>
<p>let me look a bit more clsoely at what your dif is</p>



<a name="216726038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726038">(Nov 14 2020 at 12:21)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/216726027">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/216726016">said</a>:</p>
<blockquote>
<p>I guess that I can stop here <a href="https://github.com/rust-lang/rust/blob/3461325d239ac7804ee6249ffa7d9dccae70c298/compiler/rustc_infer/src/traits/util.rs#L104">https://github.com/rust-lang/rust/blob/3461325d239ac7804ee6249ffa7d9dccae70c298/compiler/rustc_infer/src/traits/util.rs#L104</a></p>
</blockquote>
<p>I meant, not call super if this particular trait defines assoc_name</p>
</blockquote>
<p>going to check this</p>



<a name="216726092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726092">(Nov 14 2020 at 12:22)</a>:</h4>
<p>ok so</p>



<a name="216726093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726093">(Nov 14 2020 at 12:22)</a>:</h4>
<p>one thing is that <code>elaborate_predicates</code>, I believe, removes duplicates</p>



<a name="216726101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726101">(Nov 14 2020 at 12:23)</a>:</h4>
<p>oh wait</p>



<a name="216726102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726102">(Nov 14 2020 at 12:23)</a>:</h4>
<p>there's another thing :)</p>



<a name="216726111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726111">(Nov 14 2020 at 12:23)</a>:</h4>
<p>so yeah <a href="https://github.com/rust-lang/rust/blob/3461325d239ac7804ee6249ffa7d9dccae70c298/compiler/rustc_infer/src/traits/util.rs#L93-L111"><code>elaborate_trait_refs_that_define_assoc_type</code></a> is not quite right</p>



<a name="216726152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726152">(Nov 14 2020 at 12:24)</a>:</h4>
<p>it shouldn't return <code>Elaborator</code> or invoke <code>elaborate_predicates</code></p>



<a name="216726156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726156">(Nov 14 2020 at 12:24)</a>:</h4>
<p>it is an <em>alternative</em> to <code>elaborate_predicates</code></p>



<a name="216726163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726163">(Nov 14 2020 at 12:24)</a>:</h4>
<p>I think it should return a <code>Vec&lt;PolyTraitRef&lt;'tcx&gt;&gt;</code></p>



<a name="216726165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726165">(Nov 14 2020 at 12:24)</a>:</h4>
<p>or maybe a <code>FxHashSet&lt;PolyTraitRef&lt;'tcx&gt;&gt;</code></p>



<a name="216726168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726168">(Nov 14 2020 at 12:25)</a>:</h4>
<p>(the latter has the advantage of removing duplicates)</p>



<a name="216726175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726175">(Nov 14 2020 at 12:25)</a>:</h4>
<p>(which would probably fix your bug)</p>



<a name="216726179"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726179" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726179">(Nov 14 2020 at 12:25)</a>:</h4>
<p>we <em>could</em> make it return a <code>impl Iterator&lt;Item = PolyTraitRef&lt;'tcx&gt;&gt;</code></p>



<a name="216726181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726181">(Nov 14 2020 at 12:25)</a>:</h4>
<p>but I'm not sure it's worth the trouble</p>



<a name="216726183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726183">(Nov 14 2020 at 12:25)</a>:</h4>
<p>duplicates how?</p>



<a name="216726196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726196">(Nov 14 2020 at 12:25)</a>:</h4>
<p>I meant, isn't <code>Iterator</code> and <code>DoubleEndedIterator</code>?</p>



<a name="216726197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726197">(Nov 14 2020 at 12:25)</a>:</h4>
<p>basically it should return <a href="https://github.com/rust-lang/rust/blob/3461325d239ac7804ee6249ffa7d9dccae70c298/compiler/rustc_infer/src/traits/util.rs#L99">the vector <code>predicates</code></a></p>



<a name="216726214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726214">(Nov 14 2020 at 12:26)</a>:</h4>
<p>so the problem is that you have a kind of "graph"</p>



<a name="216726237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726237">(Nov 14 2020 at 12:26)</a>:</h4>
<p>where each trait-ref is a node</p>



<a name="216726239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726239">(Nov 14 2020 at 12:26)</a>:</h4>
<p>and there is an edge between two nodes if there is a "super-predicate" relationship</p>



<a name="216726241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726241">(Nov 14 2020 at 12:26)</a>:</h4>
<p>so in this case the "graph" would be:</p>
<ul>
<li>DoubleEndedIterator -&gt; Iterator</li>
</ul>



<a name="216726244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726244">(Nov 14 2020 at 12:26)</a>:</h4>
<p>we are basically doing a DFS of sorts on this graph, right?</p>



<a name="216726246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726246">(Nov 14 2020 at 12:26)</a>:</h4>
<p>the duplicates I mean are when you reach the same node via two different paths</p>



<a name="216726248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726248">(Nov 14 2020 at 12:26)</a>:</h4>
<p>in this case, if you started out with an input list like [Iterator, DoubleEndedIterator]</p>



<a name="216726255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726255">(Nov 14 2020 at 12:27)</a>:</h4>
<p>then you would reach Iterator both directly <em>and</em> as the super-trait of <code>DoubleEndedIterator</code></p>



<a name="216726257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726257">(Nov 14 2020 at 12:27)</a>:</h4>
<p>using a <code>FxHashSet</code> instead of a <code>Vec</code> would make that irrelevant</p>



<a name="216726263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726263">(Nov 14 2020 at 12:27)</a>:</h4>
<p>I'm not sure though if I'm explaining the high-level purpose here very well</p>



<a name="216726277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726277">(Nov 14 2020 at 12:28)</a>:</h4>
<p>the idea is that we have a list of traits that you know are true</p>



<a name="216726304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726304">(Nov 14 2020 at 12:28)</a>:</h4>
<p>so e.g. <code>Iterator</code>, <code>DoubleEndedIterator</code>, etc</p>



<a name="216726308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726308">(Nov 14 2020 at 12:28)</a>:</h4>
<p>and we want to elaborate out all the <em>implications</em>, kind of get to a <em>flat list</em> of all the traits</p>



<a name="216726309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726309">(Nov 14 2020 at 12:28)</a>:</h4>
<p>we know that everything which is a <code>DoubleEndedIterator</code> is also a <code>Iterator</code></p>



<a name="216726313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726313">(Nov 14 2020 at 12:28)</a>:</h4>
<p>so that is why we would add <code>Iterator</code> to the final result -- but it turns out it was there already, so it doesn't matter</p>



<a name="216726316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726316">(Nov 14 2020 at 12:29)</a>:</h4>
<p>/me waits</p>



<a name="216726385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726385">(Nov 14 2020 at 12:30)</a>:</h4>
<p>right</p>



<a name="216726404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726404">(Nov 14 2020 at 12:31)</a>:</h4>
<p>the reason that calling <code>elaborate_predicates</code> at the end is wrong is that you've <em>already done the elaboration</em></p>



<a name="216726414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726414">(Nov 14 2020 at 12:31)</a>:</h4>
<p>(i.e., that's what the while loop is doing)</p>



<a name="216726430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726430">(Nov 14 2020 at 12:31)</a>:</h4>
<p>also--</p>



<a name="216726437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726437">(Nov 14 2020 at 12:31)</a>:</h4>
<p>on <a href="https://github.com/rust-lang/rust/blob/3461325d239ac7804ee6249ffa7d9dccae70c298/compiler/rustc_infer/src/traits/util.rs#L98">line 98</a> you upcast from <code>PolyTraitRef</code> to <code>Predicate</code></p>



<a name="216726496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726496">(Nov 14 2020 at 12:32)</a>:</h4>
<p>I wouldn't do that; instead, I would filter the results of <code>super_predicates_that_define_assoc_type</code> and only keep the predicates that are trait-refs</p>



<a name="216726516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726516">(Nov 14 2020 at 12:33)</a>:</h4>
<p>ok, let me see then ...</p>



<a name="216726528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726528">(Nov 14 2020 at 12:33)</a>:</h4>
<p>i.e., call <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.Predicate.html#method.to_opt_poly_trait_ref"><code>to_opt_poly_trait_ref</code></a></p>



<a name="216726544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726544">(Nov 14 2020 at 12:33)</a>:</h4>
<p>this is because, for the purposes of resolving <code>Foo::Item</code>, we only care about trait ref predicates</p>



<a name="216726555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726555">(Nov 14 2020 at 12:33)</a>:</h4>
<p>(but this is kind of a minor point ultimately)</p>



<a name="216726609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726609">(Nov 14 2020 at 12:34)</a>:</h4>
<p>(don't worry about it to start, I just think we can tweak things to make the code a bit tighter/cleaner later on)</p>



<a name="216726639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216726639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216726639">(Nov 14 2020 at 12:34)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="216727072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727072">(Nov 14 2020 at 12:41)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">stack</span>: <span class="nb">Vec</span><span class="o">&lt;</span><span class="n">_</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">trait_refs</span><span class="p">.</span><span class="n">collect</span><span class="p">();</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">trait_refs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">vec</span><span class="o">!</span><span class="p">[];</span><span class="w"></span>

<span class="w">    </span><span class="k">while</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">trait_ref</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">.</span><span class="n">pop</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="n">trait_refs</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="n">trait_ref</span><span class="p">);</span><span class="w"></span>
<span class="w">        </span><span class="kd">let</span><span class="w"> </span><span class="n">super_predicates</span><span class="w"> </span><span class="o">=</span><span class="w"></span>
<span class="w">            </span><span class="n">tcx</span><span class="p">.</span><span class="n">super_predicates_that_define_assoc_type</span><span class="p">((</span><span class="n">trait_ref</span><span class="p">.</span><span class="n">def_id</span><span class="p">(),</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">assoc_name</span><span class="p">)));</span><span class="w"></span>
<span class="w">        </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">predicate</span><span class="p">,</span><span class="w"> </span><span class="n">_</span><span class="p">)</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">super_predicates</span><span class="p">.</span><span class="n">predicates</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="n">ty</span>::<span class="n">PredicateAtom</span>::<span class="n">Trait</span><span class="p">(</span><span class="n">data</span><span class="p">,</span><span class="w"> </span><span class="n">_</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">predicate</span><span class="p">.</span><span class="n">skip_binders</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                </span><span class="n">stack</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="n">data</span><span class="p">)</span><span class="w"></span>
<span class="w">            </span><span class="p">}</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>

<span class="w">    </span><span class="n">trait_refs</span><span class="w"></span>
</code></pre></div>



<a name="216727081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727081">(Nov 14 2020 at 12:41)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I guess you want something more like <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="216727156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727156">(Nov 14 2020 at 12:42)</a>:</h4>
<p>kinda</p>



<a name="216727188"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727188" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727188">(Nov 14 2020 at 12:43)</a>:</h4>
<p>first, I think we want a <code>FxHashSet</code>:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">stack</span>: <span class="nb">Vec</span><span class="o">&lt;</span><span class="n">_</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">trait_refs</span><span class="p">.</span><span class="n">collect</span><span class="p">();</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">trait_refs</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">FxHashSet</span>::<span class="n">default</span><span class="p">();</span><span class="w"></span>

<span class="w">    </span><span class="k">while</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">trait_ref</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">.</span><span class="n">pop</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="k">if</span><span class="w"> </span><span class="n">trait_refs</span><span class="p">.</span><span class="n">insert</span><span class="p">(</span><span class="n">trait_ref</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="kd">let</span><span class="w"> </span><span class="n">super_predicates</span><span class="w"> </span><span class="o">=</span><span class="w"></span>
<span class="w">            </span><span class="n">tcx</span><span class="p">.</span><span class="n">super_predicates_that_define_assoc_type</span><span class="p">((</span><span class="n">trait_ref</span><span class="p">.</span><span class="n">def_id</span><span class="p">(),</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">assoc_name</span><span class="p">)));</span><span class="w"></span>
<span class="w">            </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">predicate</span><span class="p">,</span><span class="w"> </span><span class="n">_</span><span class="p">)</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">super_predicates</span><span class="p">.</span><span class="n">predicates</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="n">ty</span>::<span class="n">PredicateAtom</span>::<span class="n">Trait</span><span class="p">(</span><span class="n">data</span><span class="p">,</span><span class="w"> </span><span class="n">_</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">predicate</span><span class="p">.</span><span class="n">skip_binders</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                </span><span class="n">stack</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="n">data</span><span class="p">)</span><span class="w"></span>
<span class="w">            </span><span class="p">}</span><span class="w"></span>
<span class="w">            </span><span class="p">}</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>

<span class="w">    </span><span class="n">trait_refs</span><span class="w"></span>
</code></pre></div>



<a name="216727196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727196">(Nov 14 2020 at 12:43)</a>:</h4>
<p>so something like that</p>



<a name="216727251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727251">(Nov 14 2020 at 12:44)</a>:</h4>
<p>right</p>



<a name="216727254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727254">(Nov 14 2020 at 12:44)</a>:</h4>
<p>(that's not the most efficient formulation, since we still push duplicates onto the stack, we just don't explore their super predicates twice)</p>



<a name="216727275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727275">(Nov 14 2020 at 12:44)</a>:</h4>
<p>second, I think you can replace</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="n">ty</span>::<span class="n">PredicateAtom</span>::<span class="n">Trait</span><span class="p">(</span><span class="n">data</span><span class="p">,</span><span class="w"> </span><span class="n">_</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">predicate</span><span class="p">.</span><span class="n">skip_binders</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                </span><span class="n">stack</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="n">data</span><span class="p">)</span><span class="w"></span>
<span class="w">            </span><span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>with <code>predicate.to_opt_poly_trait_ref()</code></p>



<a name="216727276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727276">(Nov 14 2020 at 12:44)</a>:</h4>
<p>I was seeing that elaborates calls to <code>filter_to_traits</code> which returns a <code>FilterToTrait</code> type</p>



<a name="216727286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727286">(Nov 14 2020 at 12:44)</a>:</h4>
<p>the difference is that it doesn't skip the <code>Binder</code></p>



<a name="216727332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727332">(Nov 14 2020 at 12:45)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/216727276">said</a>:</p>
<blockquote>
<p>I was seeing that elaborates calls to <code>filter_to_traits</code> which returns a <code>FilterToTrait</code> type</p>
</blockquote>
<p>ohh I see, I think you want to skip all this and resolve that from the function we are creating</p>



<a name="216727377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727377">(Nov 14 2020 at 12:46)</a>:</h4>
<p>yes</p>



<a name="216727380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727380">(Nov 14 2020 at 12:46)</a>:</h4>
<p>FilterToTraits it's an iterator that yields up trait references</p>



<a name="216727386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727386">(Nov 14 2020 at 12:46)</a>:</h4>
<p>right</p>



<a name="216727403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727403">(Nov 14 2020 at 12:46)</a>:</h4>
<p>so we want to return a <code>Vec&lt;ty::PolyTraitRef&lt;'tcx&gt;&gt;</code></p>



<a name="216727627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727627">(Nov 14 2020 at 12:51)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> or a <code>FxHashSet&lt;ty::PolyTraitRef&lt;'tcx&gt;&gt;</code></p>



<a name="216727637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727637">(Nov 14 2020 at 12:51)</a>:</h4>
<p>right</p>



<a name="216727643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727643">(Nov 14 2020 at 12:51)</a>:</h4>
<p>what is the binder?</p>



<a name="216727649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727649">(Nov 14 2020 at 12:51)</a>:</h4>
<p>that wraps <code>TraitRef</code></p>



<a name="216727720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727720">(Nov 14 2020 at 12:52)</a>:</h4>
<p>the <code>Binder</code> represents the possibility of a <code>for</code></p>



<a name="216727724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727724">(Nov 14 2020 at 12:52)</a>:</h4>
<p>e.g., if you have <code>for&lt;'a&gt; u32: Bar&lt;'a&gt;</code></p>



<a name="216727729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727729">(Nov 14 2020 at 12:52)</a>:</h4>
<p>something like that</p>



<a name="216727736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727736">(Nov 14 2020 at 12:52)</a>:</h4>
<p>the <code>TraitRef</code> is just the <code>u32: Bar&lt;'a&gt;</code> part</p>



<a name="216727738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727738">(Nov 14 2020 at 12:52)</a>:</h4>
<p>the <code>Binder</code> is the <code>for&lt;'a&gt;</code> part</p>



<a name="216727748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727748">(Nov 14 2020 at 12:53)</a>:</h4>
<p>you don't generally want to  <em>skip</em> the binder permanently</p>



<a name="216727753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216727753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216727753">(Nov 14 2020 at 12:53)</a>:</h4>
<p>if you do skip it, you have to kind of "account" for it</p>



<a name="216728095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216728095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216728095">(Nov 14 2020 at 13:00)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> getting 4 errors, before there were 59 :)</p>



<a name="216728112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216728112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216728112">(Nov 14 2020 at 13:01)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error[E0221]: ambiguous associated type `Item` in bounds of `A`
   --&gt; library/core/src/iter/adapters/zip.rs:132:48
    |
132 |     default fn next_back(&amp;mut self) -&gt; Option&lt;(A::Item, B::Item)&gt;
    |                                                ^^^^^^^ ambiguous associated type `Item`
    |
   ::: library/core/src/iter/traits/iterator.rs:100:5
    |
100 |     type Item;
    |     ----------
    |     |
    |     ambiguous `Item` from `Iterator`
    |     ambiguous `Item` from `Iterator`
    |
help: use fully qualified syntax to disambiguate
    |
132 |     default fn next_back(&amp;mut self) -&gt; Option&lt;(&lt;A as Iterator&gt;::Item, B::Item)&gt;
    |                                                ^^^^^^^^^^^^^^^^^^^^^
help: use fully qualified syntax to disambiguate
    |
132 |     default fn next_back(&amp;mut self) -&gt; Option&lt;(&lt;A as Iterator&gt;::Item, B::Item)&gt;
    |                                                ^^^^^^^^^^^^^^^^^^^^^

error[E0221]: ambiguous associated type `Item` in bounds of `B`
   --&gt; library/core/src/iter/adapters/zip.rs:132:57
    |
132 |     default fn next_back(&amp;mut self) -&gt; Option&lt;(A::Item, B::Item)&gt;
    |                                                         ^^^^^^^ ambiguous associated type `Item`
    |
   ::: library/core/src/iter/traits/iterator.rs:100:5
    |
100 |     type Item;
    |     ----------
    |     |
    |     ambiguous `Item` from `Iterator`
    |     ambiguous `Item` from `Iterator`
    |
help: use fully qualified syntax to disambiguate
    |
</code></pre></div>



<a name="216728114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216728114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216728114">(Nov 14 2020 at 13:01)</a>:</h4>
<p>hmmm</p>



<a name="216728527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216728527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216728527">(Nov 14 2020 at 13:12)</a>:</h4>
<div class="codehilite"><pre><span></span><code>2:rustc[1;34mDEBUG[0m [2mrustc_infer::traits::util[0m trait_refs ... {Binder(&lt;A as iter::traits::exact_size::ExactSizeIterator&gt;), Binder(&lt;Self as iter::traits::iterator::Iterator&gt;), Binder(&lt;A as iter::traits::double_ended::DoubleEndedIterator&gt;), Binder(&lt;A as iter::traits::iterator::Iterator&gt;)}
</code></pre></div>



<a name="216728538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216728538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216728538">(Nov 14 2020 at 13:13)</a>:</h4>
<p>self and A as iterators, I guess that's what conflicts?</p>



<a name="216728597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216728597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216728597">(Nov 14 2020 at 13:14)</a>:</h4>
<div class="codehilite"><pre><span></span><code>2:rustc[1;34mDEBUG[0m [2mrustc_infer::traits::util[0m processing ... trait_ref=Binder(&lt;A as iter::traits::exact_size::ExactSizeIterator&gt;)
2:rustc[1;34mDEBUG[0m [2mrustc_infer::traits::util[0m super_predicates ... GenericPredicates { parent: None, predicates: [(TraitPredicate(&lt;Self as iter::traits::iterator::Iterator&gt;), library/core/src/iter/traits/exact_size.rs:68:30: 68:38 (#0))] }
</code></pre></div>



<a name="216728607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216728607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216728607">(Nov 14 2020 at 13:15)</a>:</h4>
<p>unsure why super predicates of <code>A as ExactSizeIterator</code> gives <code>Self as Iterator</code></p>



<a name="216728611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216728611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216728611">(Nov 14 2020 at 13:15)</a>:</h4>
<p>instead of <code>A as Iterator</code></p>



<a name="216728818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216728818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216728818">(Nov 14 2020 at 13:22)</a>:</h4>
<p>hmm</p>



<a name="216728832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216728832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216728832">(Nov 14 2020 at 13:22)</a>:</h4>
<p>oh</p>



<a name="216728858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216728858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216728858">(Nov 14 2020 at 13:22)</a>:</h4>
<p>you're forgetting a substitution I think</p>



<a name="216728862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216728862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216728862">(Nov 14 2020 at 13:22)</a>:</h4>
<p>have pushed the code</p>



<a name="216728929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216728929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216728929">(Nov 14 2020 at 13:24)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> you need to call <code>subst_supertrait</code>, kind of like what happens on line 161 of <a href="http://util.rs">util.rs</a></p>



<a name="216729003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729003">(Nov 14 2020 at 13:27)</a>:</h4>
<p>oh <span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="216729048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729048">(Nov 14 2020 at 13:28)</a>:</h4>
<p>the <code>supertraits_of</code> query returns things "from the perspective" of the trait definition</p>



<a name="216729061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729061">(Nov 14 2020 at 13:29)</a>:</h4>
<p>so e.g. if you have <code>A: Foo</code> and <code>trait Foo: Bar</code>, then <code>superpredicates_of(Foo)</code> would return <code>Self: Bar</code>, and the substitution would replace <code>Self</code> with <code>A</code></p>



<a name="216729210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729210">(Nov 14 2020 at 13:32)</a>:</h4>
<p>makes sense</p>



<a name="216729267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729267">(Nov 14 2020 at 13:33)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I'm not sure what should I do with that</p>



<a name="216729271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729271">(Nov 14 2020 at 13:33)</a>:</h4>
<p>like subst_supertrait returns a new predicate</p>



<a name="216729331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729331">(Nov 14 2020 at 13:34)</a>:</h4>
<p>I guess I should get the trait_ref of that predicate?</p>



<a name="216729388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729388">(Nov 14 2020 at 13:35)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">            </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">predicate</span><span class="p">,</span><span class="w"> </span><span class="n">_</span><span class="p">)</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">super_predicates</span><span class="p">.</span><span class="n">predicates</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                </span><span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">binder</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">predicate</span><span class="p">.</span><span class="n">to_opt_poly_trait_ref</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                    </span><span class="kd">let</span><span class="w"> </span><span class="n">predicate</span><span class="w"> </span><span class="o">=</span><span class="w"></span>
<span class="w">                        </span><span class="n">predicate</span><span class="p">.</span><span class="n">subst_supertrait</span><span class="p">(</span><span class="n">tcx</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">binder</span><span class="p">.</span><span class="n">rebind</span><span class="p">(</span><span class="n">binder</span><span class="p">.</span><span class="n">skip_binder</span><span class="p">()));</span><span class="w"></span>
<span class="w">                    </span><span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">binder</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">predicate</span><span class="p">.</span><span class="n">to_opt_poly_trait_ref</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                        </span><span class="n">stack</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="n">binder</span><span class="p">);</span><span class="w"></span>
<span class="w">                    </span><span class="p">}</span><span class="w"></span>
<span class="w">                </span><span class="p">}</span><span class="w"></span>
<span class="w">            </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="216729394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729394">(Nov 14 2020 at 13:35)</a>:</h4>
<p>looks a bit weird :P</p>



<a name="216729825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729825">(Nov 14 2020 at 13:43)</a>:</h4>
<p>that's correct I think</p>



<a name="216729830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729830">(Nov 14 2020 at 13:43)</a>:</h4>
<p>well</p>



<a name="216729833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729833">(Nov 14 2020 at 13:43)</a>:</h4>
<p>ok no</p>



<a name="216729853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729853">(Nov 14 2020 at 13:44)</a>:</h4>
<p>xx</p>



<a name="216729900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729900">(Nov 14 2020 at 13:44)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">            </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">predicate</span><span class="p">,</span><span class="w"> </span><span class="n">_</span><span class="p">)</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">super_predicates</span><span class="p">.</span><span class="n">predicates</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                </span><span class="kd">let</span><span class="w"> </span><span class="n">bound_predicate</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">predicate</span><span class="p">.</span><span class="n">bound_atom</span><span class="p">();</span><span class="w"></span>
<span class="w">                </span><span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="n">ty</span>::<span class="n">PredicateAtom</span>::<span class="n">Trait</span><span class="p">(</span><span class="n">data</span><span class="p">,</span><span class="w"> </span><span class="n">_</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">bound_predicate</span><span class="p">.</span><span class="n">skip_binder</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                    </span><span class="kd">let</span><span class="w"> </span><span class="n">predicate</span><span class="w"> </span><span class="o">=</span><span class="w"></span>
<span class="w">                        </span><span class="n">predicate</span><span class="p">.</span><span class="n">subst_supertrait</span><span class="p">(</span><span class="n">tcx</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">bound_predicate</span><span class="p">.</span><span class="n">rebind</span><span class="p">(</span><span class="n">data</span><span class="p">.</span><span class="n">trait_ref</span><span class="p">));</span><span class="w"></span>
<span class="w">                    </span><span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">binder</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">predicate</span><span class="p">.</span><span class="n">to_opt_poly_trait_ref</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                        </span><span class="n">stack</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="n">binder</span><span class="p">);</span><span class="w"></span>
<span class="w">                    </span><span class="p">}</span><span class="w"></span>
<span class="w">                </span><span class="p">}</span><span class="w"></span>
<span class="w">            </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="216729901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729901">(Nov 14 2020 at 13:44)</a>:</h4>
<p>something is wacky there :)</p>



<a name="216729906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729906">(Nov 14 2020 at 13:44)</a>:</h4>
<p>testing that</p>



<a name="216729930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729930">(Nov 14 2020 at 13:45)</a>:</h4>
<p>no</p>



<a name="216729932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729932">(Nov 14 2020 at 13:45)</a>:</h4>
<p>that's using the wrong substitutions</p>



<a name="216729944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729944">(Nov 14 2020 at 13:45)</a>:</h4>
<p>first off, you should rename <code>predicate</code> to <code>super_predicate</code></p>



<a name="216729952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216729952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216729952">(Nov 14 2020 at 13:45)</a>:</h4>
<p>e.g., <code>for (super_predicate, _) in super_predicates.predicates</code></p>



<a name="216730004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216730004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216730004">(Nov 14 2020 at 13:46)</a>:</h4>
<p>so the high-level bit of logic here is that we have</p>



<a name="216730043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216730043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216730043">(Nov 14 2020 at 13:47)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">while</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">trait_ref</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">.</span><span class="n">pop</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">if</span><span class="w"> </span><span class="n">trait_refs</span><span class="p">.</span><span class="n">insert</span><span class="p">(</span><span class="n">trait_ref</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="cm">/* push super predicates from `trait_ref` */</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="216730049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216730049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216730049">(Nov 14 2020 at 13:47)</a>:</h4>
<p>you want to be doing the substitution using <strong><code>trait_ref</code></strong></p>



<a name="216730076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216730076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216730076">(Nov 14 2020 at 13:47)</a>:</h4>
<p>the code you have above is taking the substitution from the <em>super predicate</em></p>



<a name="216730078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216730078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216730078">(Nov 14 2020 at 13:47)</a>:</h4>
<p>that's backwards</p>



<a name="216730667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216730667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216730667">(Nov 14 2020 at 14:00)</a>:</h4>
<p>ok <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> so the ICE that you mentioned on <a href="https://github.com/rust-lang/rust/blob/f9669d0b409a048b300dc88440c7c0656b75b11b/compiler/rustc_typeck/src/collect.rs#L1050">this line</a> ...</p>



<a name="216730709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216730709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216730709">(Nov 14 2020 at 14:00)</a>:</h4>
<p>remember we talked about how the code you had was not accounting for predicates on "external traits"?</p>



<a name="216730859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216730859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216730859">(Nov 14 2020 at 14:04)</a>:</h4>
<p>I think you want some logic like:</p>



<a name="216730861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216730861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216730861">(Nov 14 2020 at 14:04)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> yeah</p>



<a name="216730875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216730875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216730875">(Nov 14 2020 at 14:05)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">if</span><span class="w"> </span><span class="cm">/* is not a local trait */</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">predicates_of</span><span class="p">(</span><span class="n">trait_ref</span><span class="p">);</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="o">..</span><span class="p">.</span><span class="w"> </span><span class="cm">/* existing code */</span><span class="w"></span>
</code></pre></div>



<a name="216730885"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216730885" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216730885">(Nov 14 2020 at 14:05)</a>:</h4>
<p>making French toast right now so I can't explain in more detail ;)</p>



<a name="216730887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216730887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216730887">(Nov 14 2020 at 14:05)</a>:</h4>
<p>this may return "too many" predicates  for external traits, but it's ok, because it can't create a cycle</p>



<a name="216730894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216730894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216730894">(Nov 14 2020 at 14:05)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/216730875">said</a>:</p>
<blockquote>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">if</span><span class="w"> </span><span class="cm">/* is not a local trait */</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">predicates_of</span><span class="p">(</span><span class="n">trait_ref</span><span class="p">);</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="o">..</span><span class="p">.</span><span class="w"> </span><span class="cm">/* existing code */</span><span class="w"></span>
</code></pre></div>
</blockquote>
<p>this where?</p>



<a name="216730946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216730946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216730946">(Nov 14 2020 at 14:07)</a>:</h4>
<p>ohh I see what you meant</p>



<a name="216731336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731336">(Nov 14 2020 at 14:17)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> it now compiles but the test doesn't pass</p>



<a name="216731339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731339">(Nov 14 2020 at 14:17)</a>:</h4>
<p>progress :)</p>



<a name="216731344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731344">(Nov 14 2020 at 14:17)</a>:</h4>
<p>hehe :)</p>



<a name="216731348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731348">(Nov 14 2020 at 14:17)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="c1">// check-pass</span>
<span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">Bar</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Qux</span>: <span class="nc">Foo</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nb">AsRef</span><span class="o">&lt;</span><span class="bp">Self</span>::<span class="n">Bar</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Foo2</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">trait</span><span class="w"> </span><span class="n">Qux2</span>: <span class="nc">Foo2</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nb">AsRef</span><span class="o">&lt;</span><span class="bp">Self</span>::<span class="n">Bar</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">Bar</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>



<a name="216731362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731362">(Nov 14 2020 at 14:18)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error[E0391]: cycle detected when computing the supertraits of `Qux`
 --&gt; src/test/ui/associated-type-bounds/super-trait-referencing-self.rs:5:1
  |
5 | trait Qux: Foo + AsRef&lt;Self::Bar&gt; {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: ...which again requires computing the supertraits of `Qux`, completing the cycle
note: cycle used when computing the supertraits of `Qux`
 --&gt; src/test/ui/associated-type-bounds/super-trait-referencing-self.rs:5:1
  |
5 | trait Qux: Foo + AsRef&lt;Self::Bar&gt; {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0391`.
</code></pre></div>



<a name="216731404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731404">(Nov 14 2020 at 14:18)</a>:</h4>
<p>RUST_BACKTRACE=1?</p>



<a name="216731408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731408">(Nov 14 2020 at 14:19)</a>:</h4>
<p>somehow we are calling <code>super_predicates</code> I guess :)</p>



<a name="216731474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731474">(Nov 14 2020 at 14:20)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error[E0391]: cycle detected when computing the supertraits of `Qux`
 --&gt; src/test/ui/associated-type-bounds/super-trait-referencing-self.rs:5:1
  |
5 | trait Qux: Foo + AsRef&lt;Self::Bar&gt; {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: ...which again requires computing the supertraits of `Qux`, completing the cycle
note: cycle used when collecting item types in top-level module
 --&gt; src/test/ui/associated-type-bounds/super-trait-referencing-self.rs:5:1
  |
5 | trait Qux: Foo + AsRef&lt;Self::Bar&gt; {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

thread &#39;rustc&#39; panicked at &#39;aborting due to `-Z treat-err-as-bug=1`&#39;, compiler/rustc_errors/src/lib.rs:990:27
stack backtrace:
   0: std::panicking::begin_panic
   1: rustc_errors::HandlerInner::emit_diagnostic
   2: rustc_errors::diagnostic_builder::DiagnosticBuilder::emit
   3: rustc_middle::ty::query::&lt;impl rustc_query_system::query::config::QueryAccessors&lt;rustc_middle::ty::context::TyCtxt&gt; for rustc_middle::ty::query::queries::predicates_of&gt;::handle_cycle_error
   4: rustc_data_structures::cold_path
   5: rustc_query_system::query::plumbing::get_query_impl
   6: &lt;rustc_infer::traits::util::Elaborator as core::iter::traits::iterator::Iterator&gt;::next
   7: &lt;rustc_infer::traits::util::FilterToTraits&lt;I&gt; as core::iter::traits::iterator::Iterator&gt;::next
   8: &lt;core::iter::adapters::Filter&lt;I,P&gt; as core::iter::traits::iterator::Iterator&gt;::next
   9: &lt;dyn rustc_typeck::astconv::AstConv&gt;::associated_path_to_ty
  10: &lt;dyn rustc_typeck::astconv::AstConv&gt;::ast_ty_to_ty_inner
  11: &lt;dyn rustc_typeck::astconv::AstConv&gt;::create_substs_for_ast_path
  12: &lt;dyn rustc_typeck::astconv::AstConv&gt;::create_substs_for_ast_trait_ref
  13: &lt;dyn rustc_typeck::astconv::AstConv&gt;::instantiate_poly_trait_ref_inner
  14: &lt;dyn rustc_typeck::astconv::AstConv&gt;::add_bounds
  15: &lt;dyn rustc_typeck::astconv::AstConv&gt;::compute_bounds
  16: rustc_typeck::collect::super_predicates_of
  17: rustc_middle::ty::query::&lt;impl rustc_query_system::query::config::QueryAccessors&lt;rustc_middle::ty::context::TyCtxt&gt; for rustc_middle::ty::query::queries::super_predicates_of&gt;::compute
  18: rustc_query_system::dep_graph::graph::DepGraph&lt;K&gt;::with_task_impl
  19: rustc_data_structures::stack::ensure_sufficient_stack
  20: rustc_query_system::query::plumbing::get_query_impl
  21: &lt;rustc_typeck::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor&gt;::visit_item
  22: rustc_middle::hir::map::Map::visit_item_likes_in_module
  23: rustc_typeck::collect::collect_mod_item_types
  24: rustc_middle::ty::query::&lt;impl rustc_query_system::query::config::QueryAccessors&lt;rustc_middle::ty::context::TyCtxt&gt; for rustc_middle::ty::query::queries::collect_mod_item_types&gt;::compute
  25: rustc_query_system::dep_graph::graph::DepGraph&lt;K&gt;::with_task_impl
  26: rustc_data_structures::stack::ensure_sufficient_stack
  27: rustc_query_system::query::plumbing::get_query_impl
  28: rustc_query_system::query::plumbing::ensure_query_impl
  29: rustc_session::session::Session::track_errors
  30: rustc_typeck::check_crate
  31: rustc_interface::passes::analysis
  32: rustc_middle::ty::query::&lt;impl rustc_query_system::query::config::QueryAccessors&lt;rustc_middle::ty::context::TyCtxt&gt; for rustc_middle::ty::query::queries::analysis&gt;::compute
  33: rustc_query_system::dep_graph::graph::DepGraph&lt;K&gt;::with_task_impl
  34: rustc_data_structures::stack::ensure_sufficient_stack
  35: rustc_query_system::query::plumbing::get_query_impl
  36: rustc_interface::passes::QueryContext::enter
  37: rustc_interface::queries::&lt;impl rustc_interface::interface::Compiler&gt;::enter
  38: rustc_span::with_source_map
  39: rustc_interface::interface::create_compiler_and_run
  40: rustc_span::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&amp;template=ice.md

note: rustc 1.49.0-nightly (1773f60ea 2020-11-08) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z treat-err-as-bug

query stack during panic:
#0 [super_predicates_of] computing the supertraits of `Qux`
#1 [collect_mod_item_types] collecting item types in top-level module
#2 [analysis] running analysis passes on this crate
end of query stack
</code></pre></div>



<a name="216731482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731482">(Nov 14 2020 at 14:20)</a>:</h4>
<p>everything pushed?</p>



<a name="216731498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731498">(Nov 14 2020 at 14:21)</a>:</h4>
<p>yes</p>



<a name="216731503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731503">(Nov 14 2020 at 14:21)</a>:</h4>
<p>we are calling <code>super_predicates_of</code> as you guessed :)</p>



<a name="216731631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731631">(Nov 14 2020 at 14:25)</a>:</h4>
<p>well I expect one call</p>



<a name="216731635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731635">(Nov 14 2020 at 14:25)</a>:</h4>
<p>the question is why we get to the inner one</p>



<a name="216731749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731749">(Nov 14 2020 at 14:28)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> you didn't push everything :)</p>



<a name="216731753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731753">(Nov 14 2020 at 14:28)</a>:</h4>
<p>I am still getting the ICE</p>



<a name="216731757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731757">(Nov 14 2020 at 14:28)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> pushed</p>



<a name="216731884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216731884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216731884">(Nov 14 2020 at 14:31)</a>:</h4>
<p>reading the code, I guess we need to see the logs</p>



<a name="216732163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216732163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216732163">(Nov 14 2020 at 14:36)</a>:</h4>
<p>yep</p>



<a name="216732383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216732383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216732383">(Nov 14 2020 at 14:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/216731635">said</a>:</p>
<blockquote>
<p>the question is why we get to the inner one</p>
</blockquote>
<p>by the inner one what did you mean?</p>



<a name="216732501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216732501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216732501">(Nov 14 2020 at 14:42)</a>:</h4>
<p>ok, I've been reading the code a bit and I see a few things that look wrong</p>



<a name="216732530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216732530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216732530">(Nov 14 2020 at 14:43)</a>:</h4>
<p>I made some edits that i'm testing</p>



<a name="216732548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216732548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216732548">(Nov 14 2020 at 14:43)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/216732383">said</a>:</p>
<blockquote>
<p>by the inner one what did you mean?</p>
</blockquote>
<p>well -- to have a cycle, you have to have the query Q which then calls (transitively) itself again</p>



<a name="216732550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216732550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216732550">(Nov 14 2020 at 14:43)</a>:</h4>
<p>by the "inner one" I meant that <em>second</em> call</p>



<a name="216732628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216732628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216732628">(Nov 14 2020 at 14:44)</a>:</h4>
<p>I'll push my changes, though they don't fix the problem, but they may help me to see what it is..</p>



<a name="216732640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216732640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216732640">(Nov 14 2020 at 14:45)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="216732919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216732919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216732919">(Nov 14 2020 at 14:49)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> I'm not <em>100%</em> sure but I suspect the problem is this line:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">            </span><span class="n">AstConv</span>::<span class="n">compute_bounds</span><span class="p">(</span><span class="o">&amp;</span><span class="n">icx</span><span class="p">,</span><span class="w"> </span><span class="n">self_param_ty</span><span class="p">,</span><span class="w"> </span><span class="n">bounds</span><span class="p">,</span><span class="w"> </span><span class="n">SizedByDefault</span>::<span class="n">No</span><span class="p">,</span><span class="w"> </span><span class="n">item</span><span class="p">.</span><span class="n">span</span><span class="p">);</span><span class="w"></span>
</code></pre></div>



<a name="216732927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216732927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216732927">(Nov 14 2020 at 14:49)</a>:</h4>
<p>in <code>super_predicates_that_define_assoc_type</code></p>



<a name="216732930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216732930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216732930">(Nov 14 2020 at 14:49)</a>:</h4>
<p>that is going to convert from HIR to ty</p>



<a name="216732975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216732975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216732975">(Nov 14 2020 at 14:50)</a>:</h4>
<p>and it is not filtering by <code>assoc_name</code> at all</p>



<a name="216733032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216733032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216733032">(Nov 14 2020 at 14:51)</a>:</h4>
<p>if you convert the test to use <code>where Self: Bar</code> etc, it passes</p>



<a name="216733041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216733041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216733041">(Nov 14 2020 at 14:51)</a>:</h4>
<p>I'll push one more commit, it's a good variant of the test</p>



<a name="216733134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216733134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216733134">(Nov 14 2020 at 14:53)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> ok, pushed; the trick here is that the code has two distinct paths</p>



<a name="216733141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216733141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216733141">(Nov 14 2020 at 14:53)</a>:</h4>
<p>one of them covers "where clauses" like <code>trait Foo where Self: Bar</code></p>



<a name="216733144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216733144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216733144">(Nov 14 2020 at 14:53)</a>:</h4>
<p>(that one, you have working correctly)</p>



<a name="216733149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216733149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216733149">(Nov 14 2020 at 14:53)</a>:</h4>
<p>the other covers the bound <code>Bar</code> in <code>trait Foo: Bar</code></p>



<a name="216733151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216733151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216733151">(Nov 14 2020 at 14:53)</a>:</h4>
<p>that one is not converted</p>



<a name="216734040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216734040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216734040">(Nov 14 2020 at 15:16)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> back</p>



<a name="216734781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216734781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216734781">(Nov 14 2020 at 15:36)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> does what I wrote make sense?</p>



<a name="216734937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216734937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216734937">(Nov 14 2020 at 15:39)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/216734781">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> does what I wrote make sense?</p>
</blockquote>
<p>yes</p>



<a name="216744592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216744592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216744592">(Nov 14 2020 at 19:05)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> I think you can change the signature of</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">    </span><span class="k">fn</span> <span class="nf">add_bounds</span><span class="p">(</span><span class="w"></span>
<span class="w">        </span><span class="o">&amp;</span><span class="bp">self</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">param_ty</span>: <span class="nc">Ty</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">ast_bounds</span>: <span class="kp">&amp;</span><span class="p">[</span><span class="n">hir</span>::<span class="n">GenericBound</span><span class="o">&lt;'</span><span class="nb">_</span><span class="o">&gt;</span><span class="p">],</span><span class="w"></span>
<span class="w">        </span><span class="n">bounds</span>: <span class="kp">&amp;</span><span class="nc">mut</span><span class="w"> </span><span class="n">Bounds</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
</code></pre></div>



<a name="216744638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216744638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216744638">(Nov 14 2020 at 19:06)</a>:</h4>
<p>to be something like <code>ast_bounds: impl IntoIterator&lt;Item = &amp;hir::GenericBond&lt;'_&gt;]</code></p>



<a name="216744650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216744650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216744650">(Nov 14 2020 at 19:06)</a>:</h4>
<p>then you could pass the <code>filter_map</code> to it</p>



<a name="216744654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216744654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216744654">(Nov 14 2020 at 19:06)</a>:</h4>
<p>i.e. ,and just return <code>Some(bound)</code>, not <code>Some(*bound)</code></p>



<a name="216744659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216744659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216744659">(Nov 14 2020 at 19:07)</a>:</h4>
<p>right</p>



<a name="216745041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745041">(Nov 14 2020 at 19:19)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> there's also a problem doing exactly that</p>



<a name="216745049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745049">(Nov 14 2020 at 19:19)</a>:</h4>
<p>I'd need to pass it down to <code>add_bounds</code> and to <code>is_sized</code></p>



<a name="216745093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745093">(Nov 14 2020 at 19:20)</a>:</h4>
<p>would get a <code>use of moved value</code></p>



<a name="216745095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745095">(Nov 14 2020 at 19:20)</a>:</h4>
<p>thinking how to resolve this thing ...</p>



<a name="216745117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745117">(Nov 14 2020 at 19:21)</a>:</h4>
<p>the other option is to pass a <code>Vec&lt;GenericBound&gt;</code></p>



<a name="216745185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745185">(Nov 14 2020 at 19:23)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> do you mean <code>is_unsized</code>?</p>



<a name="216745228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745228">(Nov 14 2020 at 19:24)</a>:</h4>
<p>sorry, yes</p>



<a name="216745249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745249">(Nov 14 2020 at 19:25)</a>:</h4>
<p>yeah, annoying.</p>



<a name="216745253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745253">(Nov 14 2020 at 19:25)</a>:</h4>
<p>hehe</p>



<a name="216745256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745256">(Nov 14 2020 at 19:25)</a>:</h4>
<p>you might be able to clone the iterator, or else yeah just make a vector</p>



<a name="216745258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745258">(Nov 14 2020 at 19:25)</a>:</h4>
<p>probably a <code>Vec&lt;&amp;hir::GenericBound&gt;</code></p>



<a name="216745296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745296">(Nov 14 2020 at 19:26)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="216745301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745301">(Nov 14 2020 at 19:26)</a>:</h4>
<p>question</p>



<a name="216745305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745305">(Nov 14 2020 at 19:26)</a>:</h4>
<p>well, just as a refactoring note</p>



<a name="216745307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745307">(Nov 14 2020 at 19:26)</a>:</h4>
<p>it feels like </p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">compute_bounds</span><span class="p">(</span><span class="w"></span>
<span class="w">        </span><span class="o">&amp;</span><span class="bp">self</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">param_ty</span>: <span class="nc">Ty</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">ast_bounds</span>: <span class="kp">&amp;</span><span class="p">[</span><span class="n">hir</span>::<span class="n">GenericBound</span><span class="o">&lt;'</span><span class="nb">_</span><span class="o">&gt;</span><span class="p">],</span><span class="w"></span>
<span class="w">        </span><span class="n">sized_by_default</span>: <span class="nc">SizedByDefault</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">span</span>: <span class="nc">Span</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">assoc_name</span>: <span class="nb">Option</span><span class="o">&lt;</span><span class="n">Ident</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">Bounds</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
</code></pre></div>



<a name="216745308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745308">(Nov 14 2020 at 19:27)</a>:</h4>
<p>might be better as two functions</p>



<a name="216745313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745313">(Nov 14 2020 at 19:27)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">compute_bounds</span><span class="p">(</span><span class="w"></span>
<span class="w">        </span><span class="o">&amp;</span><span class="bp">self</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">param_ty</span>: <span class="nc">Ty</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">ast_bounds</span>: <span class="kp">&amp;</span><span class="p">[</span><span class="n">hir</span>::<span class="n">GenericBound</span><span class="o">&lt;'</span><span class="nb">_</span><span class="o">&gt;</span><span class="p">],</span><span class="w"></span>
<span class="w">        </span><span class="n">sized_by_default</span>: <span class="nc">SizedByDefault</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">span</span>: <span class="nc">Span</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">Bounds</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
</code></pre></div>



<a name="216745315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745315">(Nov 14 2020 at 19:27)</a>:</h4>
<p>(as before)</p>



<a name="216745316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745316">(Nov 14 2020 at 19:27)</a>:</h4>
<p>and</p>



<a name="216745317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745317">(Nov 14 2020 at 19:27)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">compute_bounds_that_match_assoc_type</span><span class="p">(</span><span class="w"></span>
<span class="w">        </span><span class="o">&amp;</span><span class="bp">self</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">param_ty</span>: <span class="nc">Ty</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">ast_bounds</span>: <span class="kp">&amp;</span><span class="p">[</span><span class="n">hir</span>::<span class="n">GenericBound</span><span class="o">&lt;'</span><span class="nb">_</span><span class="o">&gt;</span><span class="p">],</span><span class="w"></span>
<span class="w">        </span><span class="n">sized_by_default</span>: <span class="nc">SizedByDefault</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">span</span>: <span class="nc">Span</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">assoc_name</span>: <span class="nc">Ident</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">Bounds</span><span class="o">&lt;'</span><span class="na">tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
</code></pre></div>



<a name="216745321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/216745321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#216745321">(Nov 14 2020 at 19:27)</a>:</h4>
<p>where the second one does some filtering and calls the first one</p>



<a name="217062119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217062119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217062119">(Nov 17 2020 at 21:01)</a>:</h4>
<p>@*<em>nikomatsakis</em> I'm going to start to go over the tests</p>



<a name="217062126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217062126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217062126">(Nov 17 2020 at 21:01)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/8e65dc2aa2fcfa523040c72451e9d921e96a72b4/src/test/ui/cycle-projection-based-on-where-clause.rs">https://github.com/rust-lang/rust/blob/8e65dc2aa2fcfa523040c72451e9d921e96a72b4/src/test/ui/cycle-projection-based-on-where-clause.rs</a></p>



<a name="217062138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217062138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217062138">(Nov 17 2020 at 21:01)</a>:</h4>
<p>now should compile so I guess I'd remove the test</p>



<a name="217062500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217062500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217062500">(Nov 17 2020 at 21:04)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/8e65dc2aa2fcfa523040c72451e9d921e96a72b4/src/test/ui/cycle-trait/cycle-trait-supertrait-indirect.rs">https://github.com/rust-lang/rust/blob/8e65dc2aa2fcfa523040c72451e9d921e96a72b4/src/test/ui/cycle-trait/cycle-trait-supertrait-indirect.rs</a></p>



<a name="217062528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217062528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217062528">(Nov 17 2020 at 21:04)</a>:</h4>
<p>that one probably needs a bless</p>



<a name="217062535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217062535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217062535">(Nov 17 2020 at 21:04)</a>:</h4>
<p>same for ...</p>



<a name="217062568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217062568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217062568">(Nov 17 2020 at 21:05)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/8e65dc2aa2fcfa523040c72451e9d921e96a72b4/src/test/ui/cycle-trait/cycle-trait-supertrait-direct.rs">https://github.com/rust-lang/rust/blob/8e65dc2aa2fcfa523040c72451e9d921e96a72b4/src/test/ui/cycle-trait/cycle-trait-supertrait-direct.rs</a></p>



<a name="217062921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217062921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217062921">(Nov 17 2020 at 21:08)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="cp">#![feature(unboxed_closures)]</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;</span><span class="n">F</span>: <span class="nb">Fn</span><span class="o">&lt;</span><span class="kt">i32</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="n">f</span>: <span class="nc">F</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">F</span>::<span class="n">Output</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">f</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="c1">//~ ERROR E0059</span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="217062940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217062940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217062940">(Nov 17 2020 at 21:08)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error[E0059]: cannot use call notation; the first type parameter for the function trait is neither a tuple nor unit
 --&gt; src/test/ui/error-codes/E0059.rs:3:41
  |
3 | fn foo&lt;F: Fn&lt;i32&gt;&gt;(f: F) -&gt; F::Output { f(3) } //~ ERROR E0059
  |                                         ^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0059`.
[santiago@galago rust1 (trait-inheritance-self)]$ rustc +rust1-stage1 src/test/ui/error-codes/E0059.rs
error[E0220]: associated type `Output` not found for `F`
 --&gt; src/test/ui/error-codes/E0059.rs:3:32
  |
3 | fn foo&lt;F: Fn&lt;i32&gt;&gt;(f: F) -&gt; F::Output { f(3) } //~ ERROR E0059
  |                                ^^^^^^ associated type `Output` not found

error: aborting due to previous error

For more information about this error, try `rustc --explain E0220`.
</code></pre></div>



<a name="217062980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217062980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217062980">(Nov 17 2020 at 21:08)</a>:</h4>
<p>new code can't find <code>F::Output</code> hmm</p>



<a name="217063540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217063540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217063540">(Nov 17 2020 at 21:13)</a>:</h4>
<p>I guess everything is correct but that test</p>



<a name="217063562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217063562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217063562">(Nov 17 2020 at 21:13)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/217062921">said</a>:</p>
<blockquote>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="cp">#![feature(unboxed_closures)]</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;</span><span class="n">F</span>: <span class="nb">Fn</span><span class="o">&lt;</span><span class="kt">i32</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="n">f</span>: <span class="nc">F</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">F</span>::<span class="n">Output</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">f</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="c1">//~ ERROR E0059</span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
</blockquote>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> this one <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="217063585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217063585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217063585">(Nov 17 2020 at 21:13)</a>:</h4>
<p>unsure why it can't find <code>F::Output</code></p>



<a name="217065427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217065427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217065427">(Nov 17 2020 at 21:27)</a>:</h4>
<p>well, <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span>, one thing that jumps to mind is that it requires "two jumps"</p>



<a name="217065438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217065438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217065438">(Nov 17 2020 at 21:27)</a>:</h4>
<p>we have <code>Fn</code>, <code>FnMut</code>, and finally <code>FnOnce</code></p>



<a name="217065458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217065458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217065458">(Nov 17 2020 at 21:27)</a>:</h4>
<p>could it be that there is some bug where it's not expanding <em>enough</em>?</p>



<a name="217065501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217065501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217065501">(Nov 17 2020 at 21:28)</a>:</h4>
<p>seems like a good test where you dump the output very easily, at least</p>



<a name="217065806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217065806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217065806">(Nov 17 2020 at 21:30)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130/near/217065427">said</a>:</p>
<blockquote>
<p>well, <span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span>, one thing that jumps to mind is that it requires "two jumps"</p>
</blockquote>
<p>yeah lol if that's the issue but yeah :)</p>



<a name="217065823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217065823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217065823">(Nov 17 2020 at 21:30)</a>:</h4>
<p>going to investigate tomorrow</p>



<a name="217066066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217066066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217066066">(Nov 17 2020 at 21:32)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> meanwhile can you check if this is correct <a href="https://github.com/spastorino/rust/commit/9af840c0e59323e07aae0bdf1d842092729c8891">https://github.com/spastorino/rust/commit/9af840c0e59323e07aae0bdf1d842092729c8891</a> ?</p>



<a name="217066177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217066177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217066177">(Nov 17 2020 at 21:33)</a>:</h4>
<p>besides from src/test/ui/error-codes/E0059.stderr</p>



<a name="217282544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217282544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217282544">(Nov 19 2020 at 15:13)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> so the loop I had in mind for <code>super_traits</code> would be something like</p>



<a name="217282696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217282696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217282696">(Nov 19 2020 at 15:14)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">set</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">FxHashSet</span>::<span class="n">new</span><span class="p">();</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">stack</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">vec</span><span class="o">!</span><span class="p">[];</span><span class="w"></span>
<span class="k">while</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">trait_did</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stack</span><span class="p">.</span><span class="n">pop</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">if</span><span class="w"> </span><span class="o">!</span><span class="n">set</span><span class="p">.</span><span class="n">insert</span><span class="p">(</span><span class="n">trait_did</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">continue</span><span class="p">;</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="n">stack</span><span class="p">.</span><span class="n">extend</span><span class="p">(</span><span class="n">supertraits_of</span><span class="p">(</span><span class="n">trait_did</span><span class="p">));</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="217282740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217282740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217282740">(Nov 19 2020 at 15:14)</a>:</h4>
<p>where <code>fn supertraits_of</code> either looks at HIR (if local) or uses the <code>super_predicates_of</code> query (if not local)</p>



<a name="217282762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217282762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217282762">(Nov 19 2020 at 15:15)</a>:</h4>
<p>to generate a <code>impl Iterator&lt;Item = DefId&gt;</code> or something</p>



<a name="217283640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217283640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217283640">(Nov 19 2020 at 15:21)</a>:</h4>
<p>I'm not sure I understand exactly</p>



<a name="217283729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217283729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217283729">(Nov 19 2020 at 15:21)</a>:</h4>
<p>you meant to use that loop idea in the else part of <code>super_traits_of2</code>?</p>



<a name="217283745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217283745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217283745">(Nov 19 2020 at 15:21)</a>:</h4>
<p>are you talking about a different part of the code?</p>



<a name="217283894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217283894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217283894">(Nov 19 2020 at 15:22)</a>:</h4>
<p>or are you talking about using this loop as the top code of <code>super_traits_of2</code> and differentiate if the def_id is local or not inside the loop?</p>



<a name="217284007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217284007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217284007">(Nov 19 2020 at 15:23)</a>:</h4>
<p>I'm not 100% sure what's the problem the code is having and not 100% sure what's your idea :)</p>



<a name="217285708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217285708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217285708">(Nov 19 2020 at 15:34)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="217286365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217286365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217286365">(Nov 19 2020 at 15:39)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> I guess the loop could just be <code>super_traits_of</code>, i'm not sure you need a <code>super_traits_of2</code></p>



<a name="217286378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217286378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217286378">(Nov 19 2020 at 15:39)</a>:</h4>
<p>the structure I suggested uses a loop instead of recursing</p>



<a name="217286429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217286429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217286429">(Nov 19 2020 at 15:39)</a>:</h4>
<p>the <em>bug</em> you're seeing is that when you invoke <code>super_traits_of</code> on the <code>Fn</code> trait <em>and</em> you're in an external crate,</p>



<a name="217286453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217286453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217286453">(Nov 19 2020 at 15:39)</a>:</h4>
<p>the current code just pushes the results of <code>super_predicates_of</code>, which is just <code>FnMut</code></p>



<a name="217286475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217286475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217286475">(Nov 19 2020 at 15:39)</a>:</h4>
<p>it never recurses to see that <code>FnMut</code> itself has super-predicates</p>



<a name="217286603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217286603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217286603">(Nov 19 2020 at 15:40)</a>:</h4>
<p>right <code>super_predicates_of</code> doesn't return all the ancestors, just the parent one</p>



<a name="217286610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217286610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217286610">(Nov 19 2020 at 15:40)</a>:</h4>
<p>ok</p>



<a name="217306646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217306646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217306646">(Nov 19 2020 at 17:55)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> opened <a href="https://github.com/rust-lang/rust/issues/79209">#79209</a></p>



<a name="217306672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217306672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217306672">(Nov 19 2020 at 17:55)</a>:</h4>
<p>this still needs some polishing I think but seems to be working</p>



<a name="217306872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217306872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217306872">(Nov 19 2020 at 17:56)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> cool, gonna grab a bit of lunch but we can chat in a bit</p>



<a name="217309145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217309145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217309145">(Nov 19 2020 at 18:14)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> back</p>



<a name="217309156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217309156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217309156">(Nov 19 2020 at 18:14)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="217309197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217309197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217309197">(Nov 19 2020 at 18:15)</a>:</h4>
<p>I'm looking over the PR</p>



<a name="217309203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217309203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217309203">(Nov 19 2020 at 18:15)</a>:</h4>
<p>one thing is that I had some ideas for test cases</p>



<a name="217309219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217309219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217309219">(Nov 19 2020 at 18:15)</a>:</h4>
<p>also it looks like bors is unhappy</p>



<a name="217309244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217309244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217309244">(Nov 19 2020 at 18:15)</a>:</h4>
<p>and we're going to want some comments</p>



<a name="217309283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217309283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217309283">(Nov 19 2020 at 18:16)</a>:</h4>
<p>yes</p>



<a name="217309326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217309326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217309326">(Nov 19 2020 at 18:16)</a>:</h4>
<p>what is clearly missing are comments, turning <code>super_traits_of</code> to a query if it's possible</p>



<a name="217309823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217309823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217309823">(Nov 19 2020 at 18:20)</a>:</h4>
<p>and probably a bunch of other things</p>



<a name="217309856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217309856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217309856">(Nov 19 2020 at 18:20)</a>:</h4>
<p>I'm debating about code factoring</p>



<a name="217309909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217309909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217309909">(Nov 19 2020 at 18:21)</a>:</h4>
<p>in particular I originally thought that <code>elaborate_trait_refs_that_define_assoc_type</code> ought to live in <code>rustc_typeck</code></p>



<a name="217309928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217309928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217309928">(Nov 19 2020 at 18:21)</a>:</h4>
<p>because it's kind of specialized to that particular codepath</p>



<a name="217309964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217309964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217309964">(Nov 19 2020 at 18:21)</a>:</h4>
<p>it's annoying that <code>transitive_bounds</code> is still called</p>



<a name="217310068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217310068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217310068">(Nov 19 2020 at 18:22)</a>:</h4>
<p>yeah, I need to review everything, this PR is just the "just works" code</p>



<a name="217310091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217310091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217310091">(Nov 19 2020 at 18:22)</a>:</h4>
<p>and according to bors it doesn't even "just works"</p>



<a name="217310109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217310109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217310109">(Nov 19 2020 at 18:22)</a>:</h4>
<p>which is weird because locally not only compiles everything fine but also all the tests pass</p>



<a name="217310298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217310298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217310298">(Nov 19 2020 at 18:24)</a>:</h4>
<p>gonna try a clean and re-compile everything again just in case, I guess locally I may be reusing some pre built artifacts on some crate that is the one that is failing on ci</p>



<a name="217310513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217310513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217310513">(Nov 19 2020 at 18:25)</a>:</h4>
<p>ok, i'm doing a first pass review</p>



<a name="217310524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217310524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217310524">(Nov 19 2020 at 18:25)</a>:</h4>
<p>and making a few minor suggestions</p>



<a name="217311412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217311412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217311412">(Nov 19 2020 at 18:33)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="217319212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217319212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217319212">(Nov 19 2020 at 19:33)</a>:</h4>
<p>getting ...</p>



<a name="217319219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217319219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217319219">(Nov 19 2020 at 19:33)</a>:</h4>
<div class="codehilite"><pre><span></span><code> error[E0220]: associated type `Visitor` not found for `M`
   --&gt; /cargo/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.2.13/src/fmt/format/mod.rs:527:8
    |
527 |     M::Visitor: VisitFmt + VisitOutput&lt;fmt::Result&gt;,
    |        ^^^^^^^ associated type `Visitor` not found

error: aborting due to previous error
</code></pre></div>



<a name="217319223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217319223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217319223">(Nov 19 2020 at 19:33)</a>:</h4>
<p>in the CI</p>



<a name="217319245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217319245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217319245">(Nov 19 2020 at 19:34)</a>:</h4>
<p>but <code>tracing-subscriber</code> compiles correctly locally</p>



<a name="217319293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217319293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217319293">(Nov 19 2020 at 19:34)</a>:</h4>
<p>investigating ...</p>



<a name="217319633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217319633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217319633">(Nov 19 2020 at 19:36)</a>:</h4>
<p>ahh probably the CI is using some feature flag or something particular that I'm not</p>



<a name="217321518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217321518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217321518">(Nov 19 2020 at 19:51)</a>:</h4>
<p>reproduced the issue</p>



<a name="217323691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217323691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217323691">(Nov 19 2020 at 20:08)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">Item</span>: <span class="nb">Send</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">trait</span><span class="w"> </span><span class="n">Bar</span><span class="w"></span>
<span class="k">where</span><span class="w"></span>
<span class="w">    </span><span class="bp">Self</span>: <span class="nc">Foo</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="bp">Self</span>::<span class="n">Item</span>: <span class="nb">Send</span><span class="p">,</span><span class="w"></span>
<span class="p">{</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="cp">#[allow(dead_code)]</span><span class="w"></span>
<span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;</span><span class="n">M</span><span class="o">&gt;</span><span class="p">(</span><span class="n">_m</span>: <span class="nc">M</span><span class="p">)</span><span class="w"></span>
<span class="k">where</span><span class="w"></span>
<span class="w">    </span><span class="n">M</span>: <span class="nc">Bar</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">M</span>::<span class="n">Item</span>: <span class="nb">Send</span><span class="p">,</span><span class="w"></span>
<span class="p">{</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>



<a name="217323728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217323728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217323728">(Nov 19 2020 at 20:08)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> have reduced the problem to <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="217323777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217323777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217323777">(Nov 19 2020 at 20:09)</a>:</h4>
<p>this compiles on nightly</p>



<a name="217323781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217323781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217323781">(Nov 19 2020 at 20:09)</a>:</h4>
<p>and gives ...</p>



<a name="217323803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217323803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217323803">(Nov 19 2020 at 20:09)</a>:</h4>
<div class="codehilite"><pre><span></span><code>[santiago@galago rust1 (trait-inheritance-self)]$ rustc +rust1-stage1 test.rs
error[E0220]: associated type `Item` not found for `M`
  --&gt; test.rs:16:8
   |
16 |     M::Item: Send,
   |        ^^^^ associated type `Item` not found

error: aborting due to previous error

For more information about this error, try `rustc --explain E0220`.
</code></pre></div>



<a name="217323810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217323810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217323810">(Nov 19 2020 at 20:09)</a>:</h4>
<p>in my branch</p>



<a name="217330493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217330493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217330493">(Nov 19 2020 at 21:08)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> so ... <code>super_traits_of</code> is not considering where clauses information</p>



<a name="217330577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217330577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217330577">(Nov 19 2020 at 21:09)</a>:</h4>
<p>I guess I'm a bit confused about where certain things are located</p>



<a name="217331444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217331444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217331444">(Nov 19 2020 at 21:17)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> do you need some tips :)</p>



<a name="217331475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217331475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217331475">(Nov 19 2020 at 21:17)</a>:</h4>
<p>let me just send you what I'm trying out</p>



<a name="217331495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217331495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217331495">(Nov 19 2020 at 21:17)</a>:</h4>
<p>in just a second ...</p>



<a name="217331978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217331978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217331978">(Nov 19 2020 at 21:21)</a>:</h4>
<p>ok</p>



<a name="217332195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217332195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217332195">(Nov 19 2020 at 21:23)</a>:</h4>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code><span class="gh">diff --git a/compiler/rustc_typeck/src/collect.rs b/compiler/rustc_typeck/src/collect.rs</span>
<span class="gh">index 8b457c7ceec..e5903b84130 100644</span>
<span class="gd">--- a/compiler/rustc_typeck/src/collect.rs</span>
<span class="gi">+++ b/compiler/rustc_typeck/src/collect.rs</span>
<span class="gu">@@ -1121,6 +1121,7 @@ pub fn super_traits_of(tcx: TyCtxt&lt;'_&gt;, trait_def_id: DefId) -&gt; impl Iterator&lt;It</span>
     let mut set = FxHashSet::default();
     let mut stack = vec![trait_def_id];
     while let Some(trait_did) = stack.pop() {
<span class="gi">+        debug!("super_traits_of trait_did={:?}", trait_did);</span>
         if !set.insert(trait_did) {
             continue;
         }
<span class="gu">@@ -1133,18 +1134,42 @@ pub fn super_traits_of(tcx: TyCtxt&lt;'_&gt;, trait_def_id: DefId) -&gt; impl Iterator&lt;It</span>
                 _ =&gt; bug!("super_trait_of {} is not an item", trait_hir_id),
             };

<span class="gd">-            let supertraits = match item.kind {</span>
<span class="gd">-                hir::ItemKind::Trait(.., ref supertraits, _) =&gt; supertraits,</span>
<span class="gd">-                hir::ItemKind::TraitAlias(_, ref supertraits) =&gt; supertraits,</span>
<span class="gd">-                _ =&gt; span_bug!(item.span, "super_trait_of invoked on non-trait"),</span>
<span class="gi">+            let (generics, supertraits) = match item.kind {</span>
<span class="gi">+                hir::ItemKind::Trait(.., ref generics, ref supertraits, _) =&gt; {</span>
<span class="gi">+                    (generics, supertraits)</span>
<span class="gi">+                }</span>
<span class="gi">+                hir::ItemKind::TraitAlias(ref generics, ref supertraits) =&gt; (generics, supertraits),</span>
<span class="gi">+                _ =&gt; span_bug!(item.span, "super_predicates invoked on non-trait"),</span>
             };

<span class="gi">+            debug!("super_traits_of supertraits -&gt; {:?}", supertraits);</span>
<span class="gi">+</span>
             for supertrait in supertraits.iter() {
                 let trait_ref = supertrait.trait_ref();
                 if let Some(trait_did) = trait_ref.and_then(|trait_ref| trait_ref.trait_def_id()) {
                     stack.push(trait_did);
                 }
             }
<span class="gi">+</span>
<span class="gi">+            let icx = ItemCtxt::new(tcx, trait_did);</span>
<span class="gi">+            // Convert any explicit superbounds in the where-clause,</span>
<span class="gi">+            // e.g., `trait Foo where Self: Bar`.</span>
<span class="gi">+            // In the case of trait aliases, however, we include all bounds in the where-clause,</span>
<span class="gi">+            // so e.g., `trait Foo = where u32: PartialEq&lt;Self&gt;` would include `u32: PartialEq&lt;Self&gt;`</span>
<span class="gi">+            // as one of its "superpredicates".</span>
<span class="gi">+            let is_trait_alias = tcx.is_trait_alias(trait_did);</span>
<span class="gi">+            let self_param_ty = tcx.types.self_param;</span>
<span class="gi">+            for (predicate, _) in icx.type_parameter_bounds_in_generics(</span>
<span class="gi">+                generics,</span>
<span class="gi">+                item.hir_id,</span>
<span class="gi">+                self_param_ty,</span>
<span class="gi">+                OnlySelfBounds(!is_trait_alias),</span>
<span class="gi">+                None,</span>
<span class="gi">+            ) {</span>
<span class="gi">+                if let ty::PredicateAtom::Trait(data, _) = predicate.skip_binders() {</span>
<span class="gi">+                    stack.push(data.def_id());</span>
<span class="gi">+                }</span>
<span class="gi">+            }</span>
         } else {
             let generic_predicates = tcx.super_predicates_of(trait_did);
             for (predicate, _) in generic_predicates.predicates {
<span class="gu">@@ -1155,6 +1180,7 @@ pub fn super_traits_of(tcx: TyCtxt&lt;'_&gt;, trait_def_id: DefId) -&gt; impl Iterator&lt;It</span>
         }
     }

<span class="gi">+    debug!("super_traits_of -&gt; {:?}", set);</span>
     set.into_iter()
 }
</code></pre></div>



<a name="217332206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217332206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217332206">(Nov 19 2020 at 21:23)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="217332231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217332231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217332231">(Nov 19 2020 at 21:23)</a>:</h4>
<p>compiling and gonna test in a bit</p>



<a name="217332322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217332322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217332322">(Nov 19 2020 at 21:24)</a>:</h4>
<p>unsure if I can get def_ids of things in where clauses in a different way or I need to go through predicates</p>



<a name="217332361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217332361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217332361">(Nov 19 2020 at 21:24)</a>:</h4>
<p>unsure if going through predicates is expensive</p>



<a name="217332634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217332634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217332634">(Nov 19 2020 at 21:26)</a>:</h4>
<p>ok, doing this the code now works</p>



<a name="217333557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217333557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217333557">(Nov 19 2020 at 21:34)</a>:</h4>
<p>ok</p>



<a name="217333606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217333606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217333606">(Nov 19 2020 at 21:34)</a>:</h4>
<p>I have to check the other function but that looks "roughly like" the right thing</p>



<a name="217334006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217334006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217334006">(Nov 19 2020 at 21:37)</a>:</h4>
<p>have pushed</p>



<a name="217334073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217334073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217334073">(Nov 19 2020 at 21:38)</a>:</h4>
<p>let's see if fixes CI issue, it should</p>



<a name="217334088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Assoc%20items%20on%20%60Self%60%20cycle%20errors%20%2374130/near/217334088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Assoc.20items.20on.20.60Self.60.20cycle.20errors.20.2374130.html#217334088">(Nov 19 2020 at 21:38)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/79209/commits/b69bd6117da2eff614b495a55ae19d75dec685b9">https://github.com/rust-lang/rust/pull/79209/commits/b69bd6117da2eff614b495a55ae19d75dec685b9</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>